Why the dom node cannot be obtained in mounted

Why can"t get dom node in mounted
`
mounted () {

console.log("aaaaaaa", document.getElementById("spChart"));
this.Sdisease();
// const echarts = require("echarts");
// const spxoption = echarts.init(document.getElementById("spChart"));
// console.log(spxoption);

},
`
output as null

May.13,2021

or operate


example
mounted hook can definitely get dom, find out your problem, or try refs

Menu