DavidJ-0 / vue-j-scroll.js

这是一个循环滚动插件
13 stars 3 forks source link

请问局部引入的写法是什么 #5

Open SageSanyue opened 2 years ago

SageSanyue commented 2 years ago

在项目中使用 import VueScroll from '@david-j/vue-j-scroll'; Vue.use(VueScroll);

请问如果我只在单个.vue文件内使用,正确的引入写法应该怎么写?

<vue-j-scroll></vue-j-scroll>

import VueScroll from '@david-j/vue-j-scroll';

export default {
  component: {
    VueScroll
  }
}

局部引入会报错: [Vue warn]: Unknown custom element: <vue-j-scroll> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

如果在.vue文件里写成:

<vue-j-scroll></vue-j-scroll>

import VueJScroll from '@david-j/vue-j-scroll';

export default {
  component: {
    VueJScroll
  }
}

又会报错成:[Vue warn]: Failed to mount component: template or render function not defined.

thatsgolden commented 6 months ago

引入不了,因为作者只导出了插件,没有导出原始组件