我一直试图在vue-sticky
的nuxt应用程序中导入https://github.com/rguanghui/vue-sticky(default.vue
)。我在default.vue
中的脚本标签中有此标签:
<script>
import Vue from 'vue';
if (process.browser) {
const VueSticky = require('vue-sticky');
Vue.use(VueSticky);
Vue.directive({
sticky: VueSticky,
});
}
</script>
我一直收到此错误:
[Vue warn]: Failed to resolve directive: sticky
(found in <ArticleContent> at pages/articlepage/_id.vue)
我该如何解决?
使用nuxtjs插件系统来使用外部库: