生成示例:
view部分文章来源:https://www.toymoban.com/news/detail-626248.html
<template> <uni-combox labelKey="name" valueKey="id" :candidates="candidates" placeholder="请选择" v-model="form.hospitalId"></uni-combox> </template> <script> data() { return { candidates:[], form:{ hospitalId:'', } } } methods: { baseUrl.doPost('/query/getList', {}).then(res => { this.candidates= res.data.result }) } </script>
uni-combox部分文章来源地址https://www.toymoban.com/news/detail-626248.html
<template> <view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'"> <view v-if="label" class="uni-combox__label" :style="labelStyle"> <text>{ {label}}</text> </view> <view class="uni-combox__input-box"> <input class="uni-combox__input" type="text" :placeholder="placeholder" placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus" @blur="onBlur" /> <uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector
到了这里,关于uniapp中下拉选择自定义数据的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!