vue项目报错Invalid prop: type check failed for prop "index". Expected String, got Numbe

在用vue做菜单时,控制台提示:

vue.esm.js:628 [Vue warn]: Invalid prop: type check failed for prop "index". Expected String with value "1", got Number with value 1.


image.png
解决方法::index="item.id+''"

          
                  
                  
{{item.menuname}}
{{item.menuname}}
leftMenu:[
        {
            "menuguid": "4028e5c77490d828017490e037990004",
            "menupguid": "",
            "menuname": "菜单1",
            "showname": "菜单1",
            "menupath": "Collect",
            "classname": null,
            "type": 1,
            "sort": 2,
            "valid": 1,
            "isconstruction": 0,
            "menuChildren": null
        }, {
            "menuguid": "4028e5c77490d828017490df80b20003",
            "menupguid": "",
            "menuname": "菜单2",
            "showname": "菜单2",
            "menupath": "",
            "classname": null,
            "type": 1,
            "sort": 3,
            "valid": 1,
            "isconstruction": 0,
            "menuChildren": [{
                "menuguid": "4028e5c77490d828017490e2e6280005",
                "menupguid": "4028e5c77490d828017490df80b20003",
                "menuname": "菜单2-1",
                "showname": "菜单2-1",
                "menupath": "",
                "classname": null,
                "type": 1,
                "sort": 1,
                "valid": 1,
                "isconstruction": 0,
                "menuChildren": null
            }, {
                "menuguid": "4028e5c77490d828017490e31ee70006",
                "menupguid": "4028e5c77490d828017490df80b20003",
                "menuname": "菜单2-2",
                "showname": "菜单2-2",
                "menupath": "",
                "classname": null,
                "type": 1,
                "sort": 2,
                "valid": 1,
                "isconstruction": 0,
                "menuChildren": null
            }]
        },
      ],// 左菜单
image.png

你可能感兴趣的:(vue项目报错Invalid prop: type check failed for prop "index". Expected String, got Numbe)