echarts
import { onMounted,toRefs, ref,reactive } from ‘vue’;
setup(){
//1、定义
let state = reactive({
echart: ref(),
})
const echartInit = () =>{
//2、在方法中使用
var myChart = echarts.init(state.echart);
…
}
return {
//3、发送出来
…toRefs(state),
};
普通
I am div
let box = ref(null)
//挂载
onMounted(()=>{
console.log(‘box.value’, box.value)
})