About the life cycle of vue

clipboard.png

this is elementUI"s tree control

the selected value is the

passed to me in the background.
//mounted:
    axios.get("/adSquad/findById",{
        params:{
            id:this.currentID
        }
    })
    .then(res=>{
                this.$refs.tree_Interests.setCheckedKeys(res.data.data.interest); //
            }
    })

the browser hints: "setCheckedKeys" of undefined
on second thought, it should be a life cycle problem. The tree control is assigned before it is loaded, and it prompts undefined. So is there a way to request background data after the page is loaded?


so is there a way to request background data after the page is loaded?
that can be done in mounted . For questions like
, I think we should look at the Vue documentation. If you don't understand the document, or it's not written in the document, it's better to ask questions again.

// dom
mounted(){
    // [`$nextTick`](https://cn.vuejs.org/v2/api/-sharpvm-nextTick)`API`
    this.$nextTick(() => {
        // code here
    });
}

this.$nextTick(()={
    this.$refs.tree...
})
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-1b36b2d-2c03f.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-1b36b2d-2c03f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?