- 集成IVIEW只需加入两行,在vue项目的main.js文件中加入
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
如下:
--------------main.js--------------------
import Vue from 'vue'
import App from './App'
import router from './router'
//
//集成iview
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
Vue.use(ViewUI);
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
- 然后安装IVEW包,执行 npm install view-design --save
执行完后,会在 vue项目的 package.json文件中增依赖:
"dependencies": {
"view-design": "^4.5.0-beta.1",//集成ivew
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
这样就完成了,在页面中就可以使用IVIEW组件了。