At present, the new versions of vue3.0 and vue2.0 have made great changes in the way of writing, including the issues of file packaging and ie compatibility. The ui framework I use is iviewAdmin. I have searched the Internet for a long time and it is all about the modification of vue2.0. It is in the build folder, so it can’t be used at all, and then I found the following method
The normal steps are divided into six parts:
1. Change the webpack-dev-server version to 2.71 or 2.11.1.
npm install --save-dev [email protected]
2. Install @babel/polyfill
npm install --save @babel/polyfill
3. Main.js code is added at the front
import '@babel/polyfill'
4. Delete all language packs related to main.js
1.main.js中的以下三部分注释掉:
//import i18n from '@/locale'
Vue.use(iView, {
// i18n: (key, value) => i18n.t(key, value)
})
new Vue({
el: '#app',
router,
// i18n,
store,
render: h => h(App)
})
2.还需要把components\main下的:
// this.setLocal(this.$i18n.locale)
两段注释掉
5. Modify the configuration file
编辑.babelrc
{
"presets": [["@vue/app", { "useBuiltIns": "entry" }]]
}
编辑vue.config.js
transpileDependencies: ['tree-table-vue', 'iview'],
chainWebpack: config => {
config.entry('polyfill').add('@babel/polyfill')
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
},
6. Delete TreeTable dependency
在main.js注释掉
// import TreeTable from 'tree-table-vue'
// import VOrgTree from 'v-org-tree'
以及
// Vue.use(TreeTable)
// Vue.use(VOrgTree)
This is the normal six parts that can be compatible with ie11 (personally tested it, I think it can be compatible as long as the two components of tree-table-vue and v-org-tree are not used)
Finally, I found a solution for compatibility with v-org-tree. ( https://download.csdn.net/download/qq_39215166/11367811 ) This is my download address. To be honest, I didn’t want to set up c coins Yes, but this website randomly generates c coins for me to download, and I have no choice
There is no compatibility with the tree-table-vue component for the time being. If there is a compatible partner, I hope you can share it.