update
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import DOWNICON from "../static/icons/down.png";
|
||||
import {onMounted, reactive} from "vue";
|
||||
|
||||
const emits = defineEmits(['change']);
|
||||
const {placeholder, api} = defineProps({
|
||||
placeholder: {
|
||||
type: String,
|
||||
@@ -19,6 +20,7 @@ const modelValue = defineModel();
|
||||
|
||||
const change = ({detail: {value}}) => {
|
||||
modelValue.value = list.filter(v => !v.hidden)[value].id;
|
||||
emits('change', modelValue.value);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -31,7 +33,7 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<picker :range="list.filter(v => !v.hidden).map(v => v.name)" @change="change">
|
||||
<view class="x-select">
|
||||
<view class="x-select" v-if="!$slots.default">
|
||||
<view v-if="modelValue === null" class="text-[#86909C] test-28r">
|
||||
{{ placeholder }}
|
||||
</view>
|
||||
@@ -41,6 +43,7 @@ onMounted(() => {
|
||||
|
||||
<image :src="DOWNICON" class="!size-[24rpx]" mode="aspectFill"></image>
|
||||
</view>
|
||||
<slot v-else></slot>
|
||||
</picker>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user