ui用的iview,
import Vue from 'vue'
import axios from 'axios'
import App from './App'
import router from './router'
import store from './store'
import iview from 'iview'
import 'iview/dist/styles/iview.css'
import i18n from './lang'
Vue.use(iview, {
i18n: function (path, options) {
let value = i18n.t(path, options);
if (value !== null && value !== undefined) return value;
return '';
}
});
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
components: { App },
router,
store,
i18n,
template: ''
}).$mount('#app')
样式也引入了,估计没成功。
以下是package部分包版本"electron": "^9.1.1",
"electron-builder": "^22.7.0",
"electron-debug": "^3.1.0",
"iview": "^3.4.1",
"node-loader": "^1.0.1",
"node-sass": "^4.9.2",
"require-dir": "^1.0.0",
"sass-loader": "^9.0.3",
"spectron": "^11.1.0",
"style-loader": "^1.2.1",
"url-loader": "^4.1.0",
"vue-html-loader": "^1.2.4",
"vue-loader": "^15.9.3",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.6.6",
"webpack": "^4.44.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-hot-middleware": "^2.22.2",
"webpack-merge": "^5.0.9",