鍍金池/ 問答/HTML5  HTML/ element tree setChecked 不生效?

element tree setChecked 不生效?

[

{
    "FolderId":"folder_001",
    "FolderName":"全部",
    "FolderLevel":0,
    "Disable":true,
    "children":[
        {
            "FolderId":"folder_005",
            "FolderName":"地錦路2號(hào)院",
            "FolderLevel":1,
            "Disable":true,
            "children":[
                {
                    "FolderId":"folder_1530757700031164600",
                    "FolderName":"111",
                    "FolderLevel":2,
                    "Disable":true,
                    "children":[
                        {
                            "DeviceId":"device_00001112",
                            "DeviceName":"name2",
                            "Protocol":"28281",
                            "GbId":"5.20000000000122e+20",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name2",
                            "id":"device_00001112",
                            "disabled":false
                        }
                    ],
                    "label":"111",
                    "id":"folder_1530757700031164600",
                    "disabled":true
                },
                {
                    "DeviceId":"device_00001111",
                    "DeviceName":"name1",
                    "Protocol":"28281",
                    "GbId":"520000000000122345550",
                    "Server":{
                        "ServerId":"server_0000001",
                        "ServerName":"",
                        "Protocol":"",
                        "GbId":"",
                        "Launch":false,
                        "ServerIp":"",
                        "ServerPort":0,
                        "ServerPassword":"",
                        "Devices":null
                    },
                    "StreamServerId":"",
                    "RtmpUrl":"",
                    "HttpFlvUrl":"",
                    "HlsUrl":"",
                    "ClientId":"",
                    "Launch":true,
                    "HasPtz":true,
                    "DeviceIp":"",
                    "DevicePort":0,
                    "DevicePassword":"",
                    "label":"name1",
                    "id":"device_00001111",
                    "disabled":false
                }
            ],
            "label":"地錦路2號(hào)院",
            "id":"folder_005",
            "disabled":true
        },
        {
            "FolderId":"folder_004",
            "FolderName":"地錦路1號(hào)院",
            "FolderLevel":1,
            "Disable":true,
            "children":[
                {
                    "DeviceId":"device_00001111",
                    "DeviceName":"name1",
                    "Protocol":"28281",
                    "GbId":"520000000000122345550",
                    "Server":{
                        "ServerId":"server_0000001",
                        "ServerName":"",
                        "Protocol":"",
                        "GbId":"",
                        "Launch":false,
                        "ServerIp":"",
                        "ServerPort":0,
                        "ServerPassword":"",
                        "Devices":null
                    },
                    "StreamServerId":"",
                    "RtmpUrl":"",
                    "HttpFlvUrl":"",
                    "HlsUrl":"",
                    "ClientId":"",
                    "Launch":true,
                    "HasPtz":true,
                    "DeviceIp":"",
                    "DevicePort":0,
                    "DevicePassword":"",
                    "label":"name1",
                    "id":"device_00001111",
                    "disabled":false
                },
                {
                    "DeviceId":"device_00001112",
                    "DeviceName":"name2",
                    "Protocol":"28281",
                    "GbId":"5.20000000000122e+20",
                    "Server":{
                        "ServerId":"server_0000001",
                        "ServerName":"",
                        "Protocol":"",
                        "GbId":"",
                        "Launch":false,
                        "ServerIp":"",
                        "ServerPort":0,
                        "ServerPassword":"",
                        "Devices":null
                    },
                    "StreamServerId":"",
                    "RtmpUrl":"",
                    "HttpFlvUrl":"",
                    "HlsUrl":"",
                    "ClientId":"",
                    "Launch":true,
                    "HasPtz":true,
                    "DeviceIp":"",
                    "DevicePort":0,
                    "DevicePassword":"",
                    "label":"name2",
                    "id":"device_00001112",
                    "disabled":false
                }
            ],
            "label":"地錦路1號(hào)院",
            "id":"folder_004",
            "disabled":true
        },
        {
            "FolderId":"folder_003",
            "FolderName":"水枝市",
            "FolderLevel":1,
            "Disable":true,
            "children":[
                {
                    "DeviceId":"device_00001112",
                    "DeviceName":"name2",
                    "Protocol":"28281",
                    "GbId":"5.20000000000122e+20",
                    "Server":{
                        "ServerId":"server_0000001",
                        "ServerName":"",
                        "Protocol":"",
                        "GbId":"",
                        "Launch":false,
                        "ServerIp":"",
                        "ServerPort":0,
                        "ServerPassword":"",
                        "Devices":null
                    },
                    "StreamServerId":"",
                    "RtmpUrl":"",
                    "HttpFlvUrl":"",
                    "HlsUrl":"",
                    "ClientId":"",
                    "Launch":true,
                    "HasPtz":true,
                    "DeviceIp":"",
                    "DevicePort":0,
                    "DevicePassword":"",
                    "label":"name2",
                    "id":"device_00001112",
                    "disabled":false
                },
                {
                    "DeviceId":"device_00001111",
                    "DeviceName":"name1",
                    "Protocol":"28281",
                    "GbId":"520000000000122345550",
                    "Server":{
                        "ServerId":"server_0000001",
                        "ServerName":"",
                        "Protocol":"",
                        "GbId":"",
                        "Launch":false,
                        "ServerIp":"",
                        "ServerPort":0,
                        "ServerPassword":"",
                        "Devices":null
                    },
                    "StreamServerId":"",
                    "RtmpUrl":"",
                    "HttpFlvUrl":"",
                    "HlsUrl":"",
                    "ClientId":"",
                    "Launch":true,
                    "HasPtz":true,
                    "DeviceIp":"",
                    "DevicePort":0,
                    "DevicePassword":"",
                    "label":"name1",
                    "id":"device_00001111",
                    "disabled":false
                }
            ],
            "label":"水枝市",
            "id":"folder_003",
            "disabled":true
        },
        {
            "FolderId":"folder_002",
            "FolderName":"鐘山市",
            "FolderLevel":1,
            "Disable":true,
            "children":[
                {
                    "FolderId":"folder_008",
                    "FolderName":"鐘山公安局",
                    "FolderLevel":2,
                    "Disable":true,
                    "children":[
                        {
                            "DeviceId":"device_00001112",
                            "DeviceName":"name2",
                            "Protocol":"28281",
                            "GbId":"5.20000000000122e+20",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name2",
                            "id":"device_00001112",
                            "disabled":false
                        },
                        {
                            "DeviceId":"device_00001111",
                            "DeviceName":"name1",
                            "Protocol":"28281",
                            "GbId":"520000000000122345550",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name1",
                            "id":"device_00001111",
                            "disabled":false
                        }
                    ],
                    "label":"鐘山公安局",
                    "id":"folder_008",
                    "disabled":true
                },
                {
                    "FolderId":"folder_007",
                    "FolderName":"鐘山交警大隊(duì)",
                    "FolderLevel":2,
                    "Disable":true,
                    "children":[
                        {
                            "DeviceId":"device_00001112",
                            "DeviceName":"name2",
                            "Protocol":"28281",
                            "GbId":"5.20000000000122e+20",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name2",
                            "id":"device_00001112",
                            "disabled":false
                        },
                        {
                            "DeviceId":"device_00001111",
                            "DeviceName":"name1",
                            "Protocol":"28281",
                            "GbId":"520000000000122345550",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name1",
                            "id":"device_00001111",
                            "disabled":false
                        }
                    ],
                    "label":"鐘山交警大隊(duì)",
                    "id":"folder_007",
                    "disabled":true
                },
                {
                    "FolderId":"folder_006",
                    "FolderName":"鐘山派出所",
                    "FolderLevel":2,
                    "Disable":true,
                    "children":[
                        {
                            "DeviceId":"device_00001112",
                            "DeviceName":"name2",
                            "Protocol":"28281",
                            "GbId":"5.20000000000122e+20",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name2",
                            "id":"device_00001112",
                            "disabled":false
                        },
                        {
                            "DeviceId":"device_00001111",
                            "DeviceName":"name1",
                            "Protocol":"28281",
                            "GbId":"520000000000122345550",
                            "Server":{
                                "ServerId":"server_0000001",
                                "ServerName":"",
                                "Protocol":"",
                                "GbId":"",
                                "Launch":false,
                                "ServerIp":"",
                                "ServerPort":0,
                                "ServerPassword":"",
                                "Devices":null
                            },
                            "StreamServerId":"",
                            "RtmpUrl":"",
                            "HttpFlvUrl":"",
                            "HlsUrl":"",
                            "ClientId":"",
                            "Launch":true,
                            "HasPtz":true,
                            "DeviceIp":"",
                            "DevicePort":0,
                            "DevicePassword":"",
                            "label":"name1",
                            "id":"device_00001111",
                            "disabled":false
                        }
                    ],
                    "label":"鐘山派出所",
                    "id":"folder_006",
                    "disabled":true
                }
            ],
            "label":"鐘山市",
            "id":"folder_002",
            "disabled":true
        }
    ],
    "label":"全部",
    "disabled":true,
    "id":"folder_001"
}

]

<el-tree
        :data="deviceTree"
        show-checkbox
        default-expand-all
        node-key="id"
        ref="tree"
        :highlight-current="true"
       
        check-strictly
        @check="handleNodeChecked"
        >
        </el-tree>
        

我的數(shù)據(jù)是這樣的,this.$refs.tree.setChecked(data,false); this.$refs.tree.getNode(data).checked
都是生效, 怎么回事,用例子給的數(shù)據(jù) 就生效,是數(shù)據(jù)有什么問題嗎?

回答
編輯回答
汐顏

自己人坑自己人,算了,以后再也不能相信后臺(tái)姐姐了,返回的數(shù)據(jù)太假了。

2018年1月5日 08:53