簡體   English   中英

如何在 vue.js 中添加 laravel 刀片語法?

[英]how to add laravel blade syntax inside vue.js?

I started working on a small project using vue.js and laravel , and i would like to know how can i put blade syntax inside vue.js template code or inside axios for example:

 axios.post("{{ route('myRouteName')  }}", $('#add-related-contact'))

謝謝

您應該首先使用組件道具將路由傳遞給您的組件,然后您可以使用它。

前任。

<your-component :route="{{ route('myRouteName') }}">
</your-component>
...
 methods: {
   ...
   MethodUsingAxios(){ 
     axios.post(this.route);
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM