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 7171 <el-input autocomplete =" off" v-model =" form.meta.title" ></el-input >
7272 </el-form-item >
7373 <el-form-item label =" 图标" prop =" meta.icon" style =" width :30% " >
74- <icon :getIcon = " getIcon " >
74+ <icon :icon = " icon " >
7575 <template slot="prepend" >el-icon-</template >
7676 </icon >
7777 </el-form-item >
@@ -143,19 +143,14 @@ export default {
143143 { required: true , message: " 请输入菜单展示名称" , trigger: " blur" }
144144 ]
145145 },
146- isEdit: false
146+ isEdit: false ,
147+ test: ' '
147148 };
148149 },
149150 components: {
150151 icon
151152 },
152- props: [
153- ' getIcon'
154- ],
155153 methods: {
156- getIcon (icon ){
157- this .form .meta .icon = icon
158- },
159154 setOptions () {
160155 this .menuOption = [
161156 {
@@ -295,6 +290,7 @@ export default {
295290 this .dialogTitle = " 编辑菜单" ;
296291 const res = await getBaseMenuById ({ id });
297292 this .form = res .data .menu ;
293+ this .icon = this .form .meta ;
298294 this .isEdit = true ;
299295 this .setOptions ();
300296 this .dialogFormVisible = true ;
You can’t perform that action at this time.
0 commit comments