0.0.1 • Published 10 months ago

@moment-design/choose-questionnaire v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

选择问卷组件

使用组件

安装依赖

npm install @moment-design/choose-questionnaire --save

使用组件

<template>
  <m-button type="primary" @click="open">选择问卷</m-button>
  <ChooseQuestionnaire
    ref="refChooseQuestionnaire"
    :config="config"
    @handle:change="(v: any[]) => (list = v)"
  ></ChooseQuestionnaire>
  <div style="margin-top: 16px">已选数据:{{ list }}</div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import ChooseQuestionnaire from '../index.vue';
import { queryList } from './api';

const config = {
  apis: {
    // 列表接口
    queryList,
    // 自定义参数
    params: {},
  },
};
const list: any = ref([]);
const refChooseQuestionnaire = ref();
const open = () => {
  refChooseQuestionnaire.value.open(list.value);
};
</script>

API

Props

参数名描述类型默认值
apis请求接口ApiConfig-

ApiConfig

参数名描述类型默认值
queryList列表请求接口any-
params自定义参数any-

Events

事件名描述参数
handle:change选中的数据(datas: any[])

Expose

事件名描述参数
open主动触发打开弹窗默认数据:(datas: any[])
0.0.1

10 months ago