Skip to content

Commit 1d4cbcb

Browse files
committed
编辑菜单-icon功能完善
1 parent 151ff57 commit 1d4cbcb

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

web/src/view/superAdmin/menu/icon.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,17 @@
317317
}
318318
},
319319
props:{
320-
getIcon:{
320+
icon:{
321321
default: function() {
322322
return {}
323323
},
324-
type: Function
325-
}
324+
type: Object
325+
},
326+
},
327+
created() {
328+
this.value = this.icon.icon
326329
},
327330
methods:{
328-
propIcon(icon){
329-
this.getIcon(icon)
330-
}
331331
}
332332
}
333333
</script>

web/src/view/superAdmin/menu/menu.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<el-input autocomplete="off" v-model="form.meta.title"></el-input>
7171
</el-form-item>
7272
<el-form-item label="图标" prop="meta.icon" style="width:30%">
73-
<icon :getIcon="getIcon">
73+
<icon :icon="icon">
7474
<template slot="prepend" >el-icon-</template>
7575
</icon>
7676
</el-form-item>
@@ -142,19 +142,14 @@ export default {
142142
{ required: true, message: "请输入菜单展示名称", trigger: "blur" }
143143
]
144144
},
145-
isEdit: false
145+
isEdit: false,
146+
test:''
146147
};
147148
},
148149
components:{
149150
icon
150151
},
151-
props:[
152-
'getIcon'
153-
],
154152
methods: {
155-
getIcon(icon){
156-
this.form.meta.icon = icon
157-
},
158153
setOptions() {
159154
this.menuOption = [
160155
{
@@ -294,6 +289,7 @@ export default {
294289
this.dialogTitle = "编辑菜单";
295290
const res = await getBaseMenuById({ id });
296291
this.form = res.data.menu;
292+
this.icon = this.form.meta;
297293
this.isEdit = true;
298294
this.setOptions();
299295
this.dialogFormVisible = true;

0 commit comments

Comments
 (0)