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'))
Thank you
You should first pass the route to your component using the component props, then you can use it.
Ex.
<your-component :route="{{ route('myRouteName') }}">
</your-component>
...
methods: {
...
MethodUsingAxios(){
axios.post(this.route);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.