手机型号:12pro
系统:IOS14.3(iphone7同系统显示正常。。。。)
安卓h5端正常,选项超出部分有省略号
ios端自动换行了,而且切换选项后换行部分会占用一个index导致第二列数据改变
<template>
<view>
<picker class="live-titlewrap" mode="multiSelector" :range="chooserang" range-key="alt" :value="choosetype" @columnchange="columnTap">picker测试</picker>
</view>
</template>
<script>
export default {
data() {
return {
choose:[ //摄像头选择栏数据
{
id:'1',
alt:'南区南区南区南区',
child:[
{
id:'11',
alt:'机房',
child:[
{
id:'111',
alt:'#117',
},
{
id:'111',
alt:'#118',
},
{
id:'111',
alt:'#119',
},
{
id:'111',
alt:'#117',
},
{
id:'111',
alt:'#117',
},
{
id:'111',
alt:'#118',
},
{
id:'111',
alt:'#119',
},
{
id:'111',
alt:'#117',
}
]
},
{
id:'11',
alt:'机房2',
child:[
{
id:'111',
alt:'#117',
},
{
id:'111',
alt:'#118',
},
{
id:'111',
alt:'#119',
},
{
id:'111',
alt:'#117',
}
]
}
]
},
{
id:'2',
alt:'北区',
child:[
{
id:'21',
alt:'作业区',
child:[
{
id:'211',
alt:'#907',
},
{
id:'211',
alt:'#9027',
}
]
},
{
id:'21',
alt:'作业',
child:[
{
id:'211',
alt:'#90',
}
]
}
]
},
{
id:'33',
alt:'西区',
child:[
{
id:'31',
alt:'机房',
child:[
{
id:'311',
alt:'#17',
},
{
id:'312',
alt:'#18',
}
]
}
]
},
],
choosetype:[0,0,0], //摄像头选中index
chooserang:[] ////摄像头势类型
};
},
onLoad() {
var that = this
//摄像头选择框rang数据初始化
var chooserang1 = []
var chooserang2 = []
var chooserang3 = []
for(let f in that.choose){
chooserang1[f] = {
id:that.choose[f].id,
alt:that.choose[f].alt
}
}
for(let s in that.choose[that.choosetype[0]].child){
chooserang2[s] = {
id:that.choose[that.choosetype[0]].child[s].id,
alt:that.choose[that.choosetype[0]].child[s].alt
}
}
for(let t in that.choose[that.choosetype[0]].child[that.choosetype[1]].child){
chooserang3[t] = {
id:that.choose[that.choosetype[0]].child[that.choosetype[1]].child[t].id,
alt:that.choose[that.choosetype[0]].child[that.choosetype[1]].child[t].alt
}
}
that.chooserang[0] = chooserang1
that.chooserang[1] = chooserang2
that.chooserang[2] = chooserang3
},
methods:{
columnTap(e){
// console.log(e)
var that = this
var num = e.detail.column
var typearr = that.choosetype
typearr[num] = e.detail.value
for(let i=num+1;i<typearr.length;i++){
typearr[i] = 0
}
var chooserang2 = []
var chooserang3 = []
for(let s in that.choose[typearr[0]].child){
chooserang2[s] = {
id:that.choose[typearr[0]].child[s].id,
alt:that.choose[typearr[0]].child[s].alt
}
}
for(let t in that.choose[typearr[0]].child[typearr[1]].child){
chooserang3[t] = {
id:that.choose[typearr[0]].child[typearr[1]].child[t].id,
alt:that.choose[typearr[0]].child[typearr[1]].child[t].alt
}
}
that.chooserang.splice(1,1,chooserang2)
that.chooserang.splice(2,1,chooserang3)
},
}
}
</script>
<style lang="less">
</style>
i***@outlook.com (作者)
已提交代码,选项再长一点或短一点都正常显示,就提交代码的样子在12pro上显示是换行且占位的
2021-01-04 14:01