Skip to content

穿梭框

二级筛选框的穿梭组件

Usage

点击查看代码
vue
<!--  -->
<template>
    <div>
        <q-transfer v-bind="data"></q-transfer>
    </div>
</template>

<script lang='ts' setup>
import { reactive } from 'vue'
const data = reactive({
    treeData: [],
    fieldNames: {
        key: 'value',
        title: 'label',
        children: 'children'
    },
})

</script>
<style lang='scss' scoped>
</style>

API

属性类型默认值可选值说明
treeDataITreeData--筛选框内容
targetKeys(v-model)string[]--目标值
fieldNamesIFieldNames--更改所有值的映射
returnAllbooleanfalse-是否返回父节点
changeemitemit('change', targetKeys, _perentKey);-在改变时触发
ts
export interface ITreeData {
    title: string,
    key: string,
    children?: ITreeData[],
    disabled?: boolean
}

export interface IFieldNames {
    title: string,
    key: string,
    children: string,
}

MIT Licensed