fixed not support Nuxt.js
This commit is contained in:
parent
1cbdb617bf
commit
54f510c528
2 changed files with 17 additions and 4 deletions
|
@ -22,6 +22,14 @@ module.exports = {
|
|||
libraryTarget: 'umd',
|
||||
umdNamedDefine: true
|
||||
},
|
||||
externals: {
|
||||
vue: {
|
||||
root: 'Vue',
|
||||
commonjs: 'vue',
|
||||
commonjs2: 'vue',
|
||||
amd: 'vue'
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
// using with vue-i18n in CDN
|
||||
/*eslint-disable */
|
||||
import Vue from 'vue';
|
||||
const isServer = Vue.prototype.$isServer;
|
||||
|
||||
export default function (lang) {
|
||||
if (!isServer) {
|
||||
if (typeof window.iview !== 'undefined') {
|
||||
if (!('langs' in iview)) {
|
||||
iview.langs = {};
|
||||
}
|
||||
iview.langs[lang.i.locale] = lang;
|
||||
}
|
||||
}
|
||||
};
|
||||
/*eslint-enable */
|
Loading…
Add table
Reference in a new issue