我可以使用vue CDN在laravel中使用Vue的所有功能吗? 基本上我想避免NPM和节点?
问题描述:
Can I use every functionality of Vue in laravel by just using vue CDN? Basically I want to avoid NPM and node?
Because I tried using NPM but got issues.
我可以通过使用vue CDN在laravel中使用Vue的所有功能吗? 基本上我想避免使用NPM和节点 ? p>
因为我尝试使用NPM但遇到了问题。 p> div>
答
Yup no problem. Either CDN, or just put the file on your site somewhere. (which we do, to avoid issues with app cache).
As mentionned in the comments, you need tooling for single file components, but a workaround is to define your components in .js files, one per component, with js template literals (backticks) for the template element. That way, you have your behaviour and markup together, and only the css is unscoped.