提交 ded27ddc 编写于 作者: NoSubject's avatar NoSubject

增加ElementUI组件 自动加载生产环境和开发环境的vue

上级 463ecfd5
......@@ -495,7 +495,8 @@ if (window.Promise && !Promise.any){
"JSONTemplate": ["../o2_lib/mootools/plugin/Template.js"],
"kity": ["../o2_lib/kityminder/kity/kity.js"],
"kityminder": ["../o2_lib/kityminder/core/dist/kityminder.core.js"],
"vue": ["../o2_lib/vue/vue.js"],
"vue": ["../o2_lib/vue/vue.min.js"],
"vue_develop": ["../o2_lib/vue/vue.js"],
"elementui": ["../o2_lib/vue/element/index.js"]
};
var _loaded = {};
......
......@@ -86,7 +86,7 @@ MWF.xApplication.process.FormDesigner.Module.$ElElement = MWF.FC$ElElement = new
},
_loadVue: function(callback){
if (!window.Vue){
o2.load(["vue", "elementui"], { "sequence": true }, callback);
o2.load(["vue_develop", "elementui"], { "sequence": true }, callback);
}else{
if (callback) callback();
}
......@@ -146,15 +146,14 @@ MWF.xApplication.process.FormDesigner.Module.$ElElement = MWF.FC$ElElement = new
this.vueApp = this._createVueExtend(callback);
try{
this.vm = new Vue(this.vueApp);
var p = {
"$options": {
"errorCaptured": function(err, vm, info){
alert("p: errorCaptured:"+info);
}
}
}
this.vm.$parent = p;
// var p = {
// "$options": {
// "errorCaptured": function(err, vm, info){
// alert("p: errorCaptured:"+info);
// }
// }
// }
// this.vm.$parent = p;
// this.vm.config.errorHandler = function (err, vm, info) {
// alert("errorHandler: "+info)
// }
......
......@@ -67,7 +67,8 @@ o2.xApplication.process.Xform.$ElModule = MWF.APP$ElModule = new Class(
_loadVue: function(callback){
if (!window.Vue){
o2.loadAll({"css": "../o2_lib/vue/element/index.css", "js": ["vue", "elementui"]}, { "sequence": true }, callback);
var vue = (o2.session.isDebugger) ? "vue_develop" : "vue";
o2.loadAll({"css": "../o2_lib/vue/element/index.css", "js": [vue, "elementui"]}, { "sequence": true }, callback);
}else{
if (callback) callback();
}
......
......@@ -228,7 +228,8 @@ MWF.xApplication.process.Xform.Elcheckbox = MWF.APPElcheckbox = new Class(
* @see https://vuejs.org/
* @member {VueInstance}
*/
this.vm = new Vue(this.vueApp).$mount(this.node);
this.vm = new Vue(this.vueApp);
this.vm.$mount(this.node);
},
_createVueExtend: function(callback){
......
......@@ -204,7 +204,8 @@ MWF.xApplication.process.Xform.Elradio = MWF.APPElradio = new Class(
* @see https://vuejs.org/
* @member {VueInstance}
*/
this.vm = new Vue(this.vueApp).$mount(this.node);
this.vm = new Vue(this.vueApp);
this.vm.$mount(this.node);
},
_createVueExtend: function(callback){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册