File tree Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 28
28
"bugs" : {
29
29
"url" : " https://github.com/leezng/vue-json-pretty/issues"
30
30
},
31
- "peerDependencies" : {
32
- "vue" : " ^2.3.0"
33
- },
34
31
"devDependencies" : {
35
32
"autoprefixer" : " ^7.1.2" ,
36
33
"babel-core" : " ^6.22.1" ,
63
60
"http-proxy-middleware" : " ^0.17.3" ,
64
61
"less" : " ^2.7.2" ,
65
62
"less-loader" : " ^4.0.4" ,
66
- "nightwatch" : " ^0.9.12 " ,
63
+ "nightwatch" : " ^1.0.19 " ,
67
64
"opn" : " ^5.1.0" ,
68
65
"optimize-css-assets-webpack-plugin" : " ^2.0.0" ,
69
66
"ora" : " ^1.2.0" ,
72
69
"semver" : " ^5.3.0" ,
73
70
"shelljs" : " ^0.7.6" ,
74
71
"url-loader" : " ^0.5.8" ,
75
- "vue" : " ^2.3 .0" ,
72
+ "vue" : " ^2.5 .0" ,
76
73
"vue-loader" : " ^13.0.4" ,
77
74
"vue-style-loader" : " ^3.0.1" ,
78
- "vue-template-compiler" : " ^2.3 .0" ,
75
+ "vue-template-compiler" : " ^2.5 .0" ,
79
76
"webpack" : " ^3.12.0" ,
80
77
"webpack-bundle-analyzer" : " ^2.2.1" ,
81
78
"webpack-dev-middleware" : " ^1.10.0" ,
Original file line number Diff line number Diff line change 203
203
// 单选模式
204
204
isSingle () {
205
205
return this .selectableType === ' single'
206
+ },
207
+
208
+ propsError () {
209
+ const error = this .selectableType && ! this .selectOnClickNode && ! this .showSelectController
210
+ return error ? ' When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail.' : ' '
206
211
}
207
212
},
208
213
methods: {
264
269
return this .showDoubleQuotes ? ` "${ key} "` : key
265
270
}
266
271
},
267
- created () {
268
- if ( this . selectableType && ! this . selectOnClickNode && ! this . showSelectController ) {
269
- throw new Error ( ' [vue-json-pretty] error ' )
270
- }
272
+ // 捕获一个来自子组件的错误
273
+ // 因为是递归组件,因此错误只对外暴露一次,子组件的错误不再对外传递
274
+ errorCaptured () {
275
+ return false
271
276
},
272
277
watch: {
273
278
deep (newVal ) {
274
279
this .visible = this .currentDeep <= newVal
280
+ },
281
+ propsError: {
282
+ handler (message ) {
283
+ if (message) {
284
+ throw new Error (` [vue-json-pretty] ${ message} ` )
285
+ }
286
+ },
287
+ immediate: true
275
288
}
276
289
}
277
290
}
Original file line number Diff line number Diff line change @@ -5868,7 +5868,7 @@ vue-style-loader@^3.0.0, vue-style-loader@^3.0.1:
5868
5868
hash-sum "^1.0.2"
5869
5869
loader-utils "^1.0.2"
5870
5870
5871
- vue-template-compiler@^2.3 .0 :
5871
+ vue-template-compiler@^2.5 .0 :
5872
5872
version "2.6.8"
5873
5873
resolved "http://registry.npm.taobao.org/vue-template-compiler/download/vue-template-compiler-2.6.8.tgz#750802604595134775b9c53141b9850b35255e1c"
5874
5874
dependencies :
@@ -5879,7 +5879,7 @@ vue-template-es2015-compiler@^1.6.0:
5879
5879
version "1.9.1"
5880
5880
resolved "http://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
5881
5881
5882
- vue@^2.3 .0 :
5882
+ vue@^2.5 .0 :
5883
5883
version "2.6.8"
5884
5884
resolved "http://registry.npm.taobao.org/vue/download/vue-2.6.8.tgz#f21cbc536bfc14f7d1d792a137bb12f69e60ea91"
5885
5885
You can’t perform that action at this time.
0 commit comments