mirror of https://github.com/halo-dev/halo
解决文章编辑时tag回显问题
parent
21fdcb229e
commit
17900655d7
|
@ -42,7 +42,14 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadTags()
|
this.loadTags()
|
||||||
this.selectedTagNames = this.tagIds.map(tagId => this.tagIdMap[tagId].name)
|
},
|
||||||
|
watch: {
|
||||||
|
tags(newValue, oldValue) {
|
||||||
|
// 解决tags未赋上值就使用导致的取值报错问题
|
||||||
|
if (newValue) {
|
||||||
|
this.selectedTagNames = this.tagIds.map(tagId => this.tagIdMap[tagId].name)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tagIdMap() {
|
tagIdMap() {
|
||||||
|
|
Loading…
Reference in New Issue