问题在vuejs 2组件中导入css / js文件
我有以下.vue组件文件:
<template> .... </template> <script> export default { /* stuff here*/} </script> <style> </style>
现在我想只为这个组件包含一些css / js(由themeforest上的模板提供)文件。 包括他们在标签内似乎没有工作。 任何想法有什么不对?
有关如何执行此操作的文档: https : //vue-loader.vuejs.org/en/start/spec.html#src-imports 。
<template src="./template.html"></template> <style src="./style.css" scoped></style> <script src="./script.js"></script>
请注意使用scoped
属性。 你也可以使用module
属性来代替scoped
。 更多细节