Vue使用uikit
2018-12-15 本文已影响0人
左木北鱼
1、安装uikit:npm i uikit --save-dev
2、新建src/uikit.js
import UIkit from 'uikit'
import Icons from 'uikit/dist/js/uikit-icons'
import 'uikit/dist/css/uikit.min.css'
UIkit.use(Icons)
export default (Vue, options) => {
Vue.prototype.$uikit = UIkit
}
3、main.js
引入
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import UIkit from './uikit'
Vue.config.productionTip = false
Vue.use(UIkit)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})