-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomponent.js
64 lines (58 loc) · 1.95 KB
/
component.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// 参数里面之所以有undefined,是为了防止undefined被污染。
(function (window,$,Vue,undefined) {
Vue.component('big-box', {
template: '#bigBox',
props: ['treeObj'],
data:function () {
return {
tipIsShow:false,
}
},
methods: {
},
});
/* tab切换*/
Vue.component("component-tab", {
template: "#template-tab",
data: function () {
return {
index: 0
}
},
props: ["tabList", "handle"],
methods: {
Switch: function (index) {
var disName = this.handle;
this.index = index;
if (!!disName) {
this.$dispatch(disName, this.index);
}
}
}
});
/*下拉菜单*/
Vue.component("component-combobox", {
template: "#template-combobox",
props: ["comboboxTitle", "comboboxList", "dispatch", "comboboxType", "keyName", "addedName", "unchangeTitle", "icon", "dispatchHd"],
methods: {
handle: function (index, keyName, addedName, unchangeTitle) {
$(this.$el).find(".combobox-con").slideUp();
var disName = this.dispatch;
if (!!disName) {
this.$dispatch(disName, index);
}
if (unchangeTitle === 'true') return ;
this.comboboxTitle = (addedName===undefined ? '':addedName )+ this.comboboxList[index][keyName];
},
toggleMenu: function () {
var disName = this.dispatchHd;
if (!!disName) {
this.$dispatch(disName);
}
$(this.$el).find(".combobox-con").slideToggle();
$('[p-type^="combobox"]').not(this.$el).find('.combobox-con').slideUp();
},
}
});
})(window,jQuery,Vue)