vue 封装弹窗组件注意

父组件

<template>
    <div>
    <p  @click="onDelete">
       打开
     </p>
    <!-- 弹框 -->
    <code-dialog
      :status.sync="deleteDialogStatus"
    />
  </div>
</template>
<script>
import codeDialog from "./code";
export default {
components: {
    codeDialog
  },
  name: "detailsDialog",
  data() {
    return {
      deleteDialogStatus: false
    };
  },
  methods: {
    onDelete() {
      this.deleteDialogStatus = true;
    }
};
</script>

子组件

<template>
  <div>
    <el-dialog
      title=""
      :visible.sync="show"
      :center="true"
      :show-close="false"
      :close-on-click-modal="true"
      class="deletes"
    >
    
    </el-dialog>
  </div>
</template>

 

更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/118721031

posted @ 2022-05-05 16:57  忘川信使  阅读(67)  评论(0编辑  收藏  举报