1.0.0 • Published 1 year ago

e-dialog-radio v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

基于vue+element-ui 封装的 dialog组件

功能描述

element 对话框组件

支持动态传入单选列表,根据选值不同展示不同内容

配置设计

字段名说明类型是否必填可选值默认值
title对话框titlestring非必填----
radioList单选列表object[]必填--[]
radio当前选中的单选label值string必填--''
dialogVisible弹窗是否展示boolean必填true/falsefalse
cancelText取消按钮文案string非必填--取消
sureText确认按钮文案string非必填--确认
更多dialog属性配置参考原生 el-dialog

事件

事件名说明
sure确认按钮回调() => {}
cancel取消按钮回调() => {}
dialogClose对话框关闭前回调() => {}
更多dialog事件参考原生 el-dialog

插槽

插槽名称为当前选中单选的label值

示例

vue 
<EDialogRadio
    :dialogVisible="dialogVisible"
    :title="'groups.addUser'"
    :radioList="radioList"
    :radio.sync="radio"
    width="592px"
    @dialogClose="dialogClose"
    @sure="sure"
>
	<template #aaa>
	...
    </template>
    <template #bbb>
    ...
    </template>
</EDialogRadio>

<script>
export default {
  name: '',
  data() {
    return {
		dialogVisible: false,
      radio: 'xxx',
    	radioList: [
            {
              text: 'xxx',
              label: 'aaa'
            },
            { text: 'xxx', label: 'bbb' },
            { text: 'xxxx', label: 'ccc' }
          ]
    };
  }
  computed: {

  },
  methods: {
    dialogClose() {
      // ...
      this.dialogVisible = false
      // ...
    },
    sure() {
      // ...
      console.log(this.radio)
      this.dialogVisible = false
      // ...
    }
  }
};
</script>
1.0.0

1 year ago