Invalid use of vue elementUI slot-scope

the following code is a piece of tree code in the elementUI component, but the append and remove operations on the right disappear, on some computers, but not on some computers. Is this a configuration problem or something? Please kindly help to answer, thank you very much!

< template >
< div class= "custom-tree-container" >

<div class="block">
    

scoped slot

<el-tree :data="data5" show-checkbox node-key="id" default-expand-all :expand-on-click-node="false"> <span class="custom-tree-node" slot-scope="{ node, data }"> <span>{{ data.label }}</span> <span> <el-button type="text" size="mini" @click="() => append(data)"> Append </el-button> <el-button type="text" size="mini" @click="() => remove(node, data)"> Delete </el-button> </span> </span> </el-tree> </div>

< / div >
< / template >
< script >

let id = 1000;

export default {
    data() {
        const data = [{
            id: 1,
            label: " 1",
            children: [{
                id: 4,
                label: " 1-1",
                children: [{
                    id: 9,
                    label: " 1-1-1"
                }, {
                    id: 10,
                    label: " 1-1-2"
                }]
            }]
        }, {
            id: 2,
            label: " 2",
            children: [{
                id: 5,
                label: " 2-1"
            }, {
                id: 6,
                label: " 2-2"
            }]
        }, {
            id: 3,
            label: " 3",
            children: [{
                id: 7,
                label: " 3-1"
            }, {
                id: 8,
                label: " 3-2"
            }]
        }];
        return {
            data4: JSON.parse(JSON.stringify(data)),
            data5: JSON.parse(JSON.stringify(data))
        }
    },

    methods: {
        append(data) {
            const newChild = { id: idPP, label: "testtest", children: [] };
            if (!data.children) {
                this.$set(data, "children", []);
            }
            data.children.push(newChild);
        },

        remove(node, data) {
            const parent = node.parent;
            const children = parent.data.children || parent.data;
            const index = children.findIndex(d => d.id === data.id);
            children.splice(index, 1);
        },


    }
};
Mar.07,2021

after two days of intermittent entanglement, I finally found the problem! Remembering that I had found this unanswered question, I specially registered a number to answer it.
if you follow the documents on the official website, then: npm install element-ui-S
then you are in the trap, because the default element-ui is the 2.0.0-rc version!
for people who are not familiar with webpack, this is a big pit. If you go to the official issues search, it is said that there is a problem with the vue version. You must install vue version 2.5 or above to support slot-scope
. However, I reinstall vue, and install version 2.5.16 vue, is still invalid. The vue project is really difficult to debug. At least, you can follow the code step by step at the Chrome break point with jquery, and sort out the general process. Vue seems to make template components into strings and execute eval one by one (I guessed it), which makes it difficult to debug breakpoints.
then suddenly remembered that I didn't see the element-ui version. I used npm ls element-ui to take a look at the 2.0.0-rc version! The latest Release version is 2.3.7! It is really the most deadly official trick. Hurry up to cd the project and execute a
npm install element-ui@2.3.7-S
right away for normal use of slot-scope!


Hello, have you solved this problem? I also encountered this problem. Please give me some guidance. Thank you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35e6a-2b51a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35e6a-2b51a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?