File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments