Skip to content

Commit bc1e963

Browse files
committed
support dict lazy load
1 parent 2a4344a commit bc1e963

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-data-dict",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "data dict for Vue.js",
55
"main": "src/index.js",
66
"unpkg": "dist/vue-data-dict.js",

src/lib/Dict.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export default class Dict {
3636
Vue.set(this.value, type, {})
3737
Vue.set(this.label, type, {})
3838
Vue.set(this.dict, type, [])
39+
if (dictMeta.lazy) {
40+
return
41+
}
3942
ps.push(loadDict(this, dictMeta))
4043
})
4144
return Promise.all(ps)

src/lib/DictMeta.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class DictMeta {
1414
this.responseConverter = options.mapDict || DictOptions.meta.responseConverter
1515
this.labelField = options.labelField
1616
this.valueField = options.valueField
17+
this.lazy = options.lazy === true
1718
}
1819
}
1920

0 commit comments

Comments
 (0)