-
Notifications
You must be signed in to change notification settings - Fork 48
/
vueku.js
136 lines (109 loc) · 2.89 KB
/
vueku.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
global.Vue = require('vue');
new Vue({
el: 'body',
data(){
return {
vModelLike: "",
data: {}
};
},
components: {
autocomplete: require('./vue-autocomplete.vue')
},
methods: {
clearAutocomplete() {
this.$refs.myAutocomplete.clearInput()
}
},
events: {
/**
* Global Autocomplete Callback Event
*
* @event-name autocomplete:{event-name}
* @param {String} name name of auto
* @param {Object} data
* @param {Object} json - ajax-loaded only
*/
// Autocomplete on before ajax progress
'autocomplete:before-ajax': function (name,data){
console.log('before-ajax',name,data);
},
// Autocomplete on ajax progress
'autocomplete:ajax-progress': function(name,data){
console.log('ajax-progress',data);
},
// Autocomplete on ajax loaded
'autocomplete:ajax-loaded': function(name,data,json){
console.log('ajax-loaded',data,json);
},
// Autocomplete on focus
'autocomplete:focus': function(name,evt){
console.log('focus',name,evt);
},
// Autocomplete on input
'autocomplete:input': function(name,data){
console.log('input',data);
},
// Autocomplete on blur
'autocomplete:blur': function(name,evt){
console.log('blur',evt);
},
// Autocomplete on show
'autocomplete:show': function(name){
console.log('show',name);
},
// Autocomplete on selected
'autocomplete:selected': function(name,data){
console.log('selected',data);
this.data = data;
},
// Autocomplete on hide
'autocomplete:hide': function(name){
console.log('hide',name);
},
/**
* Spesific Autocomplete Callback Event By Name
*
* @event-name autocomplete-{component-name}:{event-name}
* @param {String} name name of auto
* @param {Object} data
* @param {Object} json - ajax-loaded only
*/
// Autocomplete on before ajax progress
'autocomplete-people:before-ajax': function(data){
console.log('before-ajax-people',data);
},
// Autocomplete on ajax progress
'autocomplete-people:ajax-progress': function(data){
console.log('ajax-progress-people',data);
},
// Autocomplete on ajax loaded
'autocomplete-people:ajax-loaded': function(data,json){
console.log('ajax-loaded-people',data,json);
},
// Autocomplete-people on focus
'autocomplete-people:focus': function(evt){
console.log('focus-people',evt);
},
// Autocomplete-people on input
'autocomplete-people:input': function(data){
console.log('input-people',data);
},
// Autocomplete-people on blur
'autocomplete-people:blur': function(evt){
console.log('blur-people',evt);
},
// Autocomplete-people on show
'autocomplete-people:show': function(){
console.log('show-people');
},
// Autocomplete-people on selected
'autocomplete-people:selected': function(data){
console.log('selected-people',data);
},
// Autocomplete-people on hide
'autocomplete-people:hide': function(){
console.log('hide-people');
},
}
});