Skip to content

Commit

Permalink
修复首次加入标签时异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Aug 13, 2024
1 parent 5be0422 commit 578eeed
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions front/components/MemoEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,12 @@ const selectedTags = ref<Array<string>>([])
const selectedLabel = computed({
get:()=>selectedTags.value,
set:(labels:Array<string>)=>{
console.log('set labels',labels)
const tempLabels = Array<string>()
labels.map(label=>{
// @ts-ignore
if(typeof label !== 'string'){
console.log('label is not string',label.label)
// @ts-ignore
label = label.label
}
tempLabels.push(label)
if(!existTags.value.includes(label)){
Expand Down Expand Up @@ -207,7 +204,7 @@ const loadTags = async () => {
const res = await useMyFetch<{
tags: string[]
}>("/tag/list")
existTags.value = res.tags
existTags.value = res.tags || []
}
Expand Down

0 comments on commit 578eeed

Please sign in to comment.