<uni-data-select
v-model="formData.femMerchantsClassificationId"
:localdata="range"
@change="change">
</uni-data-select>
:localdata 绑定下拉框内容文章来源:https://www.toymoban.com/news/detail-516695.html
当下拉框内容调用后端接口时候,写法:文章来源地址https://www.toymoban.com/news/detail-516695.html
<uni-data-select
v-model="formData.femMerchantsClassificationId"
:localdata="range"
@change="change"></uni-data-select>
data() {
return {
range: [],
}
methods: {
category() {
uni.request({
url:“”,
method: 'GET',
header: {
'Authorization': 'Bearer ' + this.$TOKEN.TOKEN
},
success: (res) => {
const All = res.data
let myrange = []
All.forEach((val, index) => {
myrange.push({
value: val.femMerchantsClassificationId, // 选项id
text: val.femMerchantsClassificationName // 选项名称
})
})
this.range = myrange
}
})
}
到了这里,关于uniapp 下拉框效果使用 uni-data-select标签的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!