27 lines
560 B
Vue
27 lines
560 B
Vue
<script setup lang="ts">
|
|
// 后端字段不是 label/value 时,用 labelKey / valueKey 映射
|
|
import { ref } from 'vue'
|
|
import { G3Select } from '@g3soft/ui'
|
|
|
|
const userId = ref<number | undefined>(undefined)
|
|
|
|
const users = [
|
|
{ id: 101, name: '张三' },
|
|
{ id: 102, name: '李四' },
|
|
{ id: 103, name: '王五' },
|
|
]
|
|
</script>
|
|
|
|
<template>
|
|
<div style="width: 240px">
|
|
<G3Select
|
|
v-model="userId"
|
|
:options="users"
|
|
label-key="name"
|
|
value-key="id"
|
|
allow-clear
|
|
placeholder="选择负责人"
|
|
/>
|
|
</div>
|
|
</template>
|