优化当传入参数为 null 时报错的问题

This commit is contained in:
FungLeo 2020-05-08 10:39:04 +08:00
parent 7e84df37bd
commit 220d760d7b
4 changed files with 4 additions and 4 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ Thumbs.db
.vscode
.idea
/docs/.vuepress/dist/
package-lock.json

View File

@ -23,7 +23,7 @@
},
data: function () {
return {
val: ''
val: null
}
},
methods: {

View File

@ -25,10 +25,9 @@ export default {
},
methods: {
init() {// 初始化
this.currentValue = this.value;
this.themeName = this.theme;
this.preview = this.isPreview;
this.currentValue = this.value;
this.currentValue = this.value || '';
if (this.isPreview) {
return;
}

View File

@ -14,7 +14,7 @@ export default {
},
methods: {
init() {
this.currentValue = this.value;
this.currentValue = this.value || '';
this.themeName = this.theme;
this.preview = this.isPreview;
if (this.isPreview) {