[英]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.