File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 13
13
<br >
14
14
Please refer to
15
15
16
+
17
+
18
+
19
+
20
+
16
21
<router-link to =" /docs" >Documentation</router-link >
17
22
for more info about available tags.
18
23
19
24
25
+
26
+
27
+
28
+
29
+
20
30
</div >
21
31
<div class =" col-md-1" >
22
32
<form method =' post' action =' https://jsfiddle.net/api/post/library/pure/'
114
124
import Vue from ' vue/dist/vue.common' ;
115
125
import layout from ' ../layouts/site.vue' ;
116
126
import * as Components from ' ../../components' ;
127
+ import {debounce } from ' lodash' ;
117
128
118
129
const exampleHTML = `
119
130
<b-progress v-model="counter" variant="success" :precision="1"
149
160
originalWarn: null ,
150
161
originalError: null ,
151
162
vertical: false ,
152
- full: false
163
+ full: false ,
164
+ lazy_run_: null ,
153
165
};
154
166
},
155
167
head () {
159
171
},
160
172
watch: {
161
173
html () {
162
- this .run ();
174
+ this .lazy_run ();
163
175
},
164
176
js () {
165
- this .run ();
177
+ this .lazy_run ();
166
178
}
167
179
},
168
180
mounted () {
@@ -225,6 +237,12 @@ window.onload = function () {
225
237
<div id='app'>
226
238
${ this .html }
227
239
</div>` .trim ();
240
+ },
241
+ lazy_run () {
242
+ if (! this .lazy_run_ ) {
243
+ this .lazy_run_ = debounce (this .run .bind (this ), 500 );
244
+ }
245
+ return this .lazy_run_ ;
228
246
}
229
247
},
230
248
methods: {
@@ -252,7 +270,7 @@ window.onload = function () {
252
270
253
271
text = text .replace (' [Vue warn]: ' , ' ' );
254
272
255
- if (this .messages .length > 10 ) {
273
+ if (this .messages .length > 10 ) {
256
274
this .messages .splice (10 );
257
275
}
258
276
You can’t perform that action at this time.
0 commit comments