优化当传入参数为 null 时报错的问题
This commit is contained in:
parent
7e84df37bd
commit
220d760d7b
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ Thumbs.db
|
|||||||
.vscode
|
.vscode
|
||||||
.idea
|
.idea
|
||||||
/docs/.vuepress/dist/
|
/docs/.vuepress/dist/
|
||||||
|
package-lock.json
|
||||||
|
2
App.vue
2
App.vue
@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
val: ''
|
val: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -25,10 +25,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {// 初始化
|
init() {// 初始化
|
||||||
this.currentValue = this.value;
|
|
||||||
this.themeName = this.theme;
|
this.themeName = this.theme;
|
||||||
this.preview = this.isPreview;
|
this.preview = this.isPreview;
|
||||||
this.currentValue = this.value;
|
this.currentValue = this.value || '';
|
||||||
if (this.isPreview) {
|
if (this.isPreview) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.currentValue = this.value;
|
this.currentValue = this.value || '';
|
||||||
this.themeName = this.theme;
|
this.themeName = this.theme;
|
||||||
this.preview = this.isPreview;
|
this.preview = this.isPreview;
|
||||||
if (this.isPreview) {
|
if (this.isPreview) {
|
||||||
|
Loading…
Reference in New Issue
Block a user