当前位置:网站首页>[bottom pop-up selector] uniapp picker component - scroll selector popped up at the bottom
[bottom pop-up selector] uniapp picker component - scroll selector popped up at the bottom
2022-07-02 00:32:00 【Ma Xiaotiao's coding advanced road】
One 、 The effect to be achieved , As shown in the figure below :
Two 、 Code :
<template>
<view>
//mode : selector Is the most common selector ,[ Specific reference documentation .](https://uniapp.dcloud.io/component/picker.html)
//range : Array to bind .
//range-key : Which of the array do you want to display in the pop-up box key value . For example, I want to display in the array color title Value , It can't be written as id.
//@change : This callback function will be triggered when you click Select .
<picker @change="colorChange" :value="colorIndex" :range="colorList" range-key="title">
<view class="uni-input">{
{colorList[colorIndex].title}}</view>
</picker>
</view>
</template>
<script> export default {
data() {
return {
// Selected color subscript colorIndex:0, // stay picker The color of the selected item in the list id color_id: '', // Color list data ( Fake data , You can send a request to get the real background data in the interface function ) colorList:[ {
id: 1, title: ' Red '}, {
id: 2, title: ' green '}, {
id: 3, title: ' Blue '} ], } }, onLoad() {
this.getCaseList() }, methods: {
// Color screening colorChange(e){
this.colorIndex = e.detail.value this.getCaseList() }, // List of cases - Interface getCaseList() {
var that = this; that.page = 1; var params = {
// Color id color_id: that.colorList.length>0? that.colorList[that.colorIndex].id:'', page: that.page, limit: that.limit } this.$api.appPlateForm('POST', 'example/index', params, function(res) {
if (res.code == 200) {
that.colorList = res.data.color // Color that.colorList.unshift({
id:'',title:' Color '}); if(res.data.data.length>0){
that.caselist = res.data.data; that.page++ }else{
that.caselist =[]; } that.$forceUpdate(); } }, function(err) {
uni.showToast({
icon: 'none', title: err.msg }) }); }, }, } </script>
ending~
边栏推荐
- 2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details
- Take the enclave Park as a sample to see how Yuhua and Shaoshan play the song of Chang Zhu Tan integrated development
- 使用多线程Callable查询oracle数据库
- The new version of graphic network PDF will be released soon
- 记录一下大文件上传偶然成功偶然失败问题
- 使用htaccess文件禁止目录里的脚本执行权限
- Jielizhi Bluetooth headset quality control and production skills [chapter]
- Selectively inhibiting learning bias for active sampling
- [opencv450] hog+svm and hog+cascade for pedestrian detection
- PHP reads ini or env type configuration
猜你喜欢
Leetcode skimming: stack and queue 06 (top k high-frequency elements)
LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电
Correlation - intra group correlation coefficient
SQL Server 安装指南
Digital transformation has a long way to go, so how to take the key first step
Leetcode skimming: stack and queue 04 (delete all adjacent duplicates in the string)
Selectively inhibiting learning bias for active sampling
Leetcode skimming: stack and queue 01 (realizing queue with stack)
heketi 记录
Selectively inhibiting learning bias for active sampling
随机推荐
leetcode96不同的二叉搜索樹
UVM tutorial
Kuberntes cloud native combat high availability deployment architecture
九州云与英特尔联合发布智慧校园私有云框架,赋能教育新基建
How to type spaces in latex
Selectively inhibiting learning bias for active sampling
使用htaccess文件禁止目录里的脚本执行权限
SQL数据分析之窗口排序函数rank、dense_rank、raw_number与lag、lead窗口偏移函数【用法整理】
Is it safe for qiniu college to open an account? How to open an account?
Vue force cleaning browser cache
When installing mysql, there are two packages: Perl (data:: dumper) and Perl (JSON)
Correlation - intra group correlation coefficient
起床困难综合症(按位贪心)
Node——Egg 实现上传文件接口
Three methods of finding inverse numbers
2023款雷克萨斯ES产品公布,这回进步很有感
【CTF】bjdctf_2020_babystack2
Which securities company is safer to open a stock account
The new version of graphic network PDF will be released soon
LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电