Vue.js 为什么要使用iViewUI`<;滑块>;`模板未显示在我的项目中

Vue.js 为什么要使用iViewUI`<;滑块>;`模板未显示在我的项目中,vue.js,vuejs2,Vue.js,Vuejs2,滑块不显示(为空) 我在npm中安装iview: npm install iview --save-dev 在main.js中: import iView from 'iview' Vue.use(iView) 在myReommend.vue组件中: <template> <div> <Test01></Test01> </div> </template> <script> impor

滑块不显示(为空)

我在
npm
中安装
iview

npm install iview --save-dev
main.js
中:

import iView from 'iview'
Vue.use(iView)
在my
Reommend.vue
组件中:

<template>
  <div>
    <Test01></Test01>
  </div>
</template>

<script>

  import Test01 from '../test/test01'

  export default{

    components: {
      Test01,
    },
  }
</script>

<style scoped>

</style>
当I
npm运行dev
时,不显示滑块,只显示
123


如果我在
main.js
中注释
Vue.use(iView)
,将报告错误:

vue.esm.js?efeb:578 [Vue warn]: Unknown custom element: <Slider> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
vue.esm.js?efeb:578[vue warn]:未知自定义元素:-您是否正确注册了组件?对于递归组件,请确保提供“name”选项。
那么,为什么
模板没有显示在我的项目中呢

官方文件是:

因此,您的
main.js
将具有:

import iView from 'iview';
import 'iview/dist/styles/iview.css';
Vue.use(iView);

import 'iview/dist/styles/iview.css';
import iView from 'iview';
import 'iview/dist/styles/iview.css';
Vue.use(iView);