wuxw
2019-08-13 9e29441646434d9f54a2c3e855a724633885d8a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
    初始化vue 对象
    @param vc vue component对象
    @param vmOptions Vue参数
**/
(function(vc,vmOptions){
    console.log("vmOptions:",vmOptions);
    vc.component = new Vue(vmOptions);
})(window.vc,window.vc.vmOptions);
 
 
/**
    vc监听事件
**/
(function(vc){
     /**
            事件监听
     **/
    vc.on = function(_componentName,_value,_callback){
        vc.component.$on(_componentName+'_'+_value,_callback);
    };
 
    /**
            事件触发
    **/
    vc.emit = function(_componentName,_value,_param){
        vc.component.$emit(_componentName+'_'+_value,_param);
    };
 
})(window.vc);
 
/**
 * vue对象 执行初始化方法
 */
(function(vc){
    vc.initEvent.forEach(function(eventMethod){
        eventMethod();
   });
   vc.initMethod.forEach(function(callback){
        callback();
   });
})(window.vc);