0.0.5 • Published 7 months ago
@moment-design/choose-channel v0.0.5
选择渠道组件
使用组件
安装依赖
npm install @moment-design/choose-channel --save使用组件
<template>
<l-content title="选择渠道">
<m-button type="primary" @click="open">选择渠道</m-button>
<ChooseChannel
ref="refChooseChannel"
@handle:change="(v: any[]) => (list = v)"
></ChooseChannel>
<div style="margin-top: 16px">已选数据:{{ list }}</div>
</l-content>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import ChooseChannel from "@moment-design/choose-channel";
import "@moment-design/choose-channel/dist/css/index.css";
import "@moment-design/choose-channel/dist/css/index.less";
import ChooseChannel from '../index.vue';
const list: any = ref([]);
const refChooseChannel = ref();
const open = () => {
refChooseChannel.value.open(list.value);
};
</script>API
Props
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| max | 最多选择数量 | number | 10 |
| apis | 请求接口 | ApiConfig | - |
ApiConfig
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| queryGroupList | 渠道分组请求接口 | any | - |
| queryChannelList | 渠道列表请求接口 | any | - |
Events
| 事件名 | 描述 | 参数 |
|---|---|---|
| handle:change | 选中的数据 | (datas: any[]) |
Expose
| 事件名 | 描述 | 参数 |
|---|---|---|
| open | 主动触发打开弹窗 | 默认数据:(datas: any[]) |