uni-app页面多个picker ,如何解决不冲突

 json数据:

treatFeature: [
				{ newindex: 0, key: 'strength', name: '力度', types: ['力度偏弱', '力度适中', '力度偏强'] },
				{ newindex: 0, key: 'full', name: '饱满度', types: ['脉体不充盈', '充盈适中', '脉体充盈'] },
				{ newindex: 0, key: 'thickness', name: '粗细度', types: ['偏细', '粗细适中', '偏粗'] },
				{ newindex: 0, key: 'temperature', name: '温度', types: ['体温凉', '体温正常', '体温热'] },
				{ newindex: 0, key: 'potential', name: '脉势', types: ['脉势小', '脉势大'] },
				{ newindex: 0, key: 'speed', name: '缓急', types: ['缓动', '急动'] },
				{ newindex: 0, key: 'soft', name: '刚柔', types: ['柔', '刚柔适中', '刚'] },
				{
					newindex: 0,
					key: 'Depression',
					name: '郁',
					types: ['左位郁', '左轾右轾里郁', '右轾左轩', '左轩右轩表郁', '左位郁右位郁', '左侧郁', '右位郁', '左侧郁', '左侧郁左轾']
				},
				{ newindex: 0, key: 'Stasis', name: '淤', types: ['轻度瘀', '中度瘀', '重度瘀'] },
				{ newindex: 0, key: 'water', name: '水', types: ['轻度痰', '中度痰'] },
				{ newindex: 0, key: 'wet', name: '湿', types: ['轻度湿', '中度湿', '重度湿'] },
				{ newindex: 0, key: 'sputum', name: '痰', types: ['轻度痰', '中度痰'] }
			]

页面结构代码:


				脉象特征
				
					{{ feature.name }}
					
						
						{{ feature.types[feature.newindex] }}
					
				
			

 JavaScript逻辑代码:

bindPickerChange: function(e) {
			const curindex = e.target.dataset.current;		
			this.treatFeature[curindex].newindex = e.target.value;
			
		},

成功解决:

原文章链接

https://blog.csdn.net/yangsitong1314/article/details/77672415

你可能感兴趣的:(json,vue)