mirror of https://github.com/halo-dev/halo-admin
完成删除主题的功能
parent
5db6073634
commit
1cc799e505
|
@ -32,4 +32,11 @@ themeApi.active = theme => {
|
|||
})
|
||||
}
|
||||
|
||||
themeApi.delete = key => {
|
||||
return service({
|
||||
url: `${baseUrl}/${key}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export default themeApi
|
||||
|
|
|
@ -26,7 +26,13 @@
|
|||
<a-button type="primary" v-if="activatedTheme == theme.key" disabled>已启用</a-button>
|
||||
<a-button type="primary" @click="activeTheme(theme.key)" v-else>启用</a-button>
|
||||
<a-button @click="optionModal(theme.key)" v-if="activatedTheme == theme.key">设置</a-button>
|
||||
<a-popconfirm :title="'确定删除【'+theme.properties.name+'】主题?'" @confirm="deleteTheme(theme.key)" okText="确定" cancelText="取消" v-else>
|
||||
<a-popconfirm
|
||||
:title="'确定删除【' + theme.properties.name + '】主题?'"
|
||||
@confirm="deleteTheme(theme.key)"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
v-else
|
||||
>
|
||||
<a-button type="dashed">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-button-group>
|
||||
|
@ -72,8 +78,11 @@ export default {
|
|||
this.loadThemes()
|
||||
})
|
||||
},
|
||||
deleteTheme(theme) {
|
||||
this.$message.success('删除' + theme)
|
||||
deleteTheme(key) {
|
||||
themeApi.delete(key).then(response => {
|
||||
this.$message.success('删除成功!')
|
||||
this.loadThemes()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue