//挂载组件
let container = document.getElementById('containerID') //containerID要挂载在哪里
const comp = new (Vue.extend(CompName))({ propsData: props }).$mount() //CompName组件名
container.appendChild(comp.$el) //挂载组件
//取消挂载
let container = document.getElementById('containerID')
container.removeChild(container.childNodes[0])
06-07
718
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-27
883
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交