Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
fix: clear validation results while editing. (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaneL1u committed Mar 10, 2022
1 parent 5b17179 commit bb28b3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/views/post/TagList.vue
Expand Up @@ -66,7 +66,7 @@
<template slot="title">
<span>{{ tag.postCount }} 篇文章</span>
</template>
<post-tag :tag="tag" style="margin-bottom: 8px; cursor: pointer" @click.native="form.model = tag" />
<post-tag :tag="tag" style="margin-bottom: 8px; cursor: pointer" @click.native="handleEdit(tag)" />
</a-tooltip>
</a-spin>
</a-card>
Expand Down Expand Up @@ -123,6 +123,10 @@ export default {
this.handleListTags()
},
methods: {
handleEdit(tag) {
this.form.model = tag
this.$refs.tagForm.clearValidate()
},
handleListTags() {
this.list.loading = true
apiClient.tag
Expand Down
6 changes: 5 additions & 1 deletion src/views/sheet/independent/LinkList.vue
Expand Up @@ -121,7 +121,7 @@
</template>
<ellipsis slot="name" slot-scope="text" :length="15" tooltip>{{ text }}</ellipsis>
<span slot="action" slot-scope="text, record">
<a-button class="!p-0" type="link" @click="form.model = record">编辑</a-button>
<a-button class="!p-0" type="link" @click="handleEdit(record)">编辑</a-button>
<a-divider type="vertical" />
<a-popconfirm
:title="'你确定要删除【' + record.name + '】链接?'"
Expand Down Expand Up @@ -274,6 +274,10 @@ export default {
this.optionsModal.data = response.data
})
},
handleEdit(record) {
this.form.model = record
this.$refs.linkForm.clearValidate()
},
handleDeleteLink(id) {
apiClient.link
.delete(id)
Expand Down

0 comments on commit bb28b3f

Please sign in to comment.