管理端新增文章时删除全部选项

master
lemon橪 2021-10-06 17:01:30 +08:00
parent 4f2f6e8d20
commit 47da7d3b16
1 changed files with 5 additions and 2 deletions

View File

@ -48,12 +48,13 @@
<Input v-model="form.title" clearable style="width: 40%" /> <Input v-model="form.title" clearable style="width: 40%" />
</FormItem> </FormItem>
<FormItem label="文章分类" prop="categoryId"> <FormItem label="文章分类" prop="categoryId">
<Select v-model="treeValue" placeholder="请选择" clearable style="width: 180px"> <Select v-model="treeValue" placeholder="请选择" clearable style="width: 180px">
<Option :value="treeValue" style="display: none">{{ <Option :value="treeValue" style="display: none">{{
treeValue treeValue
}} }}
</Option> </Option>
<Tree :data="treeData" @on-select-change="handleCheckChange"></Tree> <Tree :data="treeDataDefault" @on-select-change="handleCheckChange"></Tree>
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="文章排序" prop="sort"> <FormItem label="文章排序" prop="sort">
@ -108,7 +109,7 @@ export default {
modalType: 0, // modalType: 0, //
modalVisible: false, // modalVisible: false, //
modalTitle: "", // modalTitle: "", //
treeDataDefault:"",
searchForm: { searchForm: {
// //
pageNumber: 1, // pageNumber: 1, //
@ -308,6 +309,7 @@ export default {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
this.treeData = this.getTree(res.result); this.treeData = this.getTree(res.result);
this.treeDataDefault = this.getTree(res.result);
this.treeData.unshift({ this.treeData.unshift({
title: "全部", title: "全部",
level: 0, level: 0,
@ -388,6 +390,7 @@ export default {
this.modalType = 0; this.modalType = 0;
this.modalTitle = "添加文章"; this.modalTitle = "添加文章";
this.treeValue = ''; this.treeValue = '';
this.form = { this.form = {
sort: 1, sort: 1,
content:'' content:''