Vue3+elementplus实现弹窗功能

父组件:






  




 const prizeDialogVisible = ref(false);
 const openPrizeDialog = () => {
      prizeDialogVisible.value = true;
    };
 const getPrizeMsessage = (params) => {
      console.log('333', params);
    };

子组件:

 








 props: {
    prizeVisible: {
      type: Boolean,
      required: true
    }
  },
  emits: ['update:prizeVisible', 'handleSave', 'getPrizeMsessage'],
    const handleClose = () => {
      emit('update:prizeVisible', false);
    };

    let Category = ref([]);
    const handleSave = () => {
      Category.value = tableData.value.map((item) => {
        return item.Activity_Prize_Category;
      });

      emit('getPrizeMsessage', Category.value);
      emit('update:prizeVisible', false);
    };
    

 

你可能感兴趣的:(javascript,前端,vue.js)