我有以下.vue组件文件: <template> …. </template> <script> export default { /* stuff here*/} </script> <style> </style> 现在我想只为这个组件包含一些css / js(由themeforest上的模板提供)文件。 包括他们在标签内似乎没有工作。 任何想法有什么不对?
我正在使用vue-loader,而且我正面临一个问题,因为我已经在主要的app.js中创build了一个用于组件的指令,但不能在组件中使用该指令。 我收到这个消息: vue.common.js?e881:1014 [Vue warn]: Failed to resolve directive: swiper (found in component: <testimonial-comp>) app.js import Vue from 'vue'; import App from './App.vue'; new Vue({ el: '#app', components: { App }, directives: { swiper: { bind: function () { console.log('my directive'); } } } }); App.vue <template lang="jade"> testimonial-comp </template> <script> import TestimonialComp from './components/Testimonial.vue' […]