Tag remove feature

pull/9/head
MyFaith 2019-04-10 21:34:02 +08:00
parent 881674ab87
commit a14dc91ddb
3 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.DS_Store
node_modules
/dist
yarn.lock
# local env files
.env.local

View File

@ -52,4 +52,3 @@ export default {}
padding-bottom: 0;
}
</style>

View File

@ -34,7 +34,7 @@
<template slot="title">
<span>{{ tag.postCount }} 篇文章</span>
</template>
<a-tag color="green">{{ tag.name }}</a-tag>
<a-tag closable @close="deleteTag(tag.id)" color="green">{{ tag.name }}</a-tag>
</a-tooltip>
</a-card>
</a-col>
@ -44,6 +44,7 @@
<script>
import tagApi from '@/api/tag'
import { closeSync } from 'fs';
export default {
data() {
return {
@ -71,8 +72,9 @@ export default {
this.loadTags()
})
},
deleteTag(index) {
tagApi.delete(this.tags[index]).then(response => {
deleteTag(tagId) {
tagApi.delete(tagId).then(response => {
this.$message.success('删除成功!')
this.loadTags()
})
}