<!--wxnml-->
<picker bindchange="XS_Model" value="{{XS_Model_index}}" range="{{XS_Model_array}}">
<view class="XS_Model_picker">
梯型:{{XS_Model_array[XS_Model_index]}}
</view>
</picker><!--梯型-->
/** js */
data: {
XS_Model_array: ['ML-PE02', 'ML-PE01', 'ML-K', 'ML-WK'],
objectXS_Model_array: [
{id: 0,name:'ML-PE02'},
{id: 1,name:'ML-PE01'},
{id: 2,name:'ML-K'},
{id: 3,name:'ML-WK'},
],
}
onLoad:function(){
app.globalData.XS_Model=this.data.objectXS_Model_array
console.log(app.globalData.XS_Model)
}
})
1、app.js
2、storage
3、借助插件,mobx之类的
js文件: 新定义一个XS_Model方法: XS_Model(e) { app.globalData.XS_Model = e.detail.value }