Files
workspace/code/g3soft-libs/docs/examples/select/multiple.vue
T
2026-10-08 22:38:34 +08:00

22 lines
621 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// multiple:值为数组,选中后下拉保持打开;再次点击可取消
import { ref } from 'vue'
import { G3Select } from '@g3soft/ui'
const selected = ref<number[]>([1])
const options = [
{ label: '可读', value: 1 },
{ label: '可写', value: 2 },
{ label: '可删除', value: 3 },
{ label: '可授权', value: 4 },
]
</script>
<template>
<div style="width: 260px">
<G3Select v-model="selected" :options="options" multiple placeholder="选择权限" />
<p style="margin: 8px 0 0; font-size: 13px; color: #6b7280">已选:{{ selected }}</p>
</div>
</template>