1.使用v-if
在组件上定义v-if一个布尔变量
1.变量改为false
2.变量改为true
2.
import dialog from '@compintent/dialog' components: {dialog} this.$destroy('dialog');
3.
// get~ 销毁组件 destroyElement() { this.$destroy(true); this.$el.parentNode.removeChild(this.$el); },
1.使用v-if
在组件上定义v-if一个布尔变量
1.变量改为false
2.变量改为true
2.
import dialog from '@compintent/dialog' components: {dialog} this.$destroy('dialog');
3.
// get~ 销毁组件 destroyElement() { this.$destroy(true); this.$el.parentNode.removeChild(this.$el); },
上一篇:css设置鼠标hover效果
vue 组件(如对话框组件)实时创建与销毁: 使用v-if
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M