Vuejs js for multiple pages, not for a single page application

后端 未结 2 1218
抹茶落季
抹茶落季 2021-01-30 05:23

I need to build an application using laravel 5.3 and vuejs 2, because I need to use two-way binding rather than use jquery.

I need to set up the views with blade templa

2条回答
  •  清酒与你
    2021-01-30 06:27

    1. Create your 'app' for every page in seperate JS files. Good practice would be using the same name as page name to get it clear where it belongs.
    2. Name you main div the same as the file (fileName.php + assets/js/fileName.js).
    3. Use #fileName' as yourel`
    4. in blade use @{{ vue expressions }} to let Blade skip this and allow VueJS handle that.

    Done. Good luck!

提交回复
热议问题