<template>
  <div>
    <my-pop
      :pop_type="pop_type"
      :title="title"
      :cancel="cancel"
      :confirm="confirm"
      :content="content"
      :inp_placeholder="inp_placeholder"
      @confirm="popConfirm"
      @cancel="popCancel"
    ></my-pop>
  </div>
</template>
<script>
import pop from "@/components/pop";
export default {
  name: "HelloView",
  components: {
    "my-pop": pop,
  },
  data() {
    return {
      pop_type: "content",
      title: "弹窗标题",
      cancel: "取消",
      confirm: "确认",
      content: "弹窗显示的文本内容",
      inp_placeholder: "请输入内容",
    };
  },
  methods: {
    // 弹窗左边按钮触发函数
    popConfirm(e) {
      // e 用于接受弹窗传递的数据
      // 点击函数触发弹窗 confirm
      console.log("click confirm");
    },
    // 弹窗右边按钮触发函数
    popCancel() {
      console.log("click cancel");
    },
  },
};
</script>
