我有以下.vue组件文件:
<template>
....
</template>
<script>
export default { /* stuff here*/}
</script>
<style>
</style>
现在我想在此组件中包含一些css / js(由themeforest上的模板提供)文件。在标签内包含它们似乎不起作用。知道什么是错的吗?
答案 0 :(得分:1)
关于如何执行此操作的文档: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
。 More details