electron-vue,启动之后没了样式和图片是什么原因呢,请大佬帮忙康康
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: '<App/>'
}).$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",
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已经找到了原因,
css-loader
升级4.2之后,vue-style-loader@4.1.0
两年没维护导致版本不匹配。将vue-style-loader
替换成style-loader@1.2.1
新版本后,样式正常。webpack.config.js