0.0.8 • Published 8 months ago
@moment-design/choose-mini-link v0.0.8
选择小程序链接组件
使用组件
安装依赖
npm install @moment-design/choose-mini-link --save使用组件
<template>
<!-- 按钮 -->
<m-space>
<m-button type="primary" @click="open">选择小程序链接</m-button>
</m-space>
<!-- 组件 -->
<ChooseMiniLink
ref="refChooseMiniLink"
:config="config"
@choose="(v) => (data = v)"
></ChooseMiniLink>
<!-- 数据 -->
<div style="margin-top: 16px">
已选数据:
{{ data }}
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import ChooseMiniLink from '@moment-design/choose-mini-link';
import "@moment-design/choose-mini-link/dist/css/index.css";
import {
getActivityMarketingList,
getCouponList,
getDecorationList,
getFunctionList,
getGoodsDetail,
getGoodsCategoryTree,
getGoodsGroup,
getMarketingList,
} from './api';
const refChooseMiniLink = ref();
const config = {
title: '选择小程序链接',
apis: {
syy: {
getActivityMarketingList,
getCouponList,
getDecorationList,
getFunctionList,
getGoodsDetail,
getGoodsCategoryTree,
getGoodsGroup,
getMarketingList,
},
xsy: {
getCouponList,
getDecorationList,
getFunctionList,
getGoodsDetail,
getGoodsCategoryTree,
},
},
tabs: [1, 2, 3],
};
const data = ref();
const open = () => {
refChooseMiniLink.value.open(data.value);
};
</script>API
Props
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| title | 弹出选择框的标题 | string | 选择小程序链接 |
| apis | 列表请求接口 | ApiConfig | - |
| tabs | tabs 显示数据(商业云: 1,销售云:2,其他:3) | Array | 1,2,3 |
| syyTabs | 商业云 Tabs(功能页面: 1,商品分组: 2,商品详情: 3,装修页面: 4,优惠券: 5,活动营销: 6,营销专区: 7) | Array | 1, 2, 3, 4, 5, 6, 7 |
| xsyTabs | 销售云 Tabs(功能页面: 1,商品分组: 3,装修页面: 4,优惠券: 5) | Array | 1, 3, 4, 5 |
ApiConfig
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| syy | 商业云列表请求接口 | SyyApiConfig | - |
| xsy | 销售云列表请求接口 | XyyApiConfig | - |
SyyApiConfig
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| getActivityMarketingList | 商业云功能页面请求接口 | Function | - |
| getCouponList | 商业云商品分组请求接口 | Function | - |
| getDecorationList | 商业云商品详情请求接口 | Function | - |
| getFunctionList | 商业云商品分类请求接口 | Function | - |
| getGoodsDetail | 商业云装修页面请求接口 | Function | - |
| getGoodsCategoryTree | 商业云优惠券请求接口 | Function | - |
| getGoodsGroup | 商业云活动营销请求接口 | Function | - |
| getMarketingList | 商业云营销专区请求接口 | Function | - |
XyyApiConfig
| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| getCouponList | 销售云商品分组请求接口 | Function | - |
| getDecorationList | 销售云商品详情请求接口 | Function | - |
| getFunctionList | 销售云商品分类请求接口 | Function | - |
| getGoodsDetail | 销售云装修页面请求接口 | Function | - |
| getGoodsCategoryTree | 销售云优惠券请求接口 | Function | - |
Events
| 事件名 | 描述 | 参数 |
|---|---|---|
| choose | 选中的数据 | (v: any[], item: any) |
Expose
| 事件名 | 描述 | 参数 |
|---|---|---|
| open | 主动触发打开弹窗 | - |