Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

typescript el-dialog打不开

最近用vue+ts+ele改写项目,写弹窗组件时 碰到了一些问题


el-dialog弹窗isShow 数据变了但是弹窗打不开,设置isShow默认true时,关闭方法不执行,请问我这是哪里出现了问题了呢,希望各位帮看看,感谢~

父页面

//标签
<group-view ref="groupView"></group-view>
//引用方式
import GroupView from "@/views/pages/group/dialog/demo.vue";
script lang="ts"下
//父打开el-dialog方法
private toView(id: any)?{
 (this.$refs.groupView as any).open(id);
 }

子页面

<template>

 <!--?<div?class="group-view">?-->

 <el-dialog

 ref="BroadcastDialog"

 title="详情"

 :visible.sync="isShow"

 width="80%"

 :close-on-click-modal="false"

 >

 <div class="group-view__content">1</div>

 </el-dialog>

 <!--?</div>?-->

</template>

<script lang="ts">

import { Component, Prop, Vue, Provide } from "vue-property-decorator";

export default class demo extends Vue {

 @Provide() private isShow: Boolean = false;

 private open()?{

 this.isShow = true;

 }

}

</script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

我去找了别人的项目对比了一下 弹框组件里缺少了这个导致无法正常显示 我也是醉了,原因不清楚,单加上这个 一切恢复正常了

@Component({})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...