Kipper-liu

闲着没事弄个小程序练练手 整理下方便日后看

用的是iview-webapp ui插件,框架mpvue,看mpvue api 就能搭建一个小demo 上手很快

先整理一个小坑

小程序不支持select 标签, 刚好ui 插件也没得,看了下小程序是用picker 替代了select 看着api 就写了一个不过对应下面的 option  是空白的 原来是range 这个属性的问题 

 

<picker @change="handlePickerChange" :value="selectedIndex" :range="messagess">
<view class="picker">当前消息:{{ messagess[selectedIndex] }}</view>
</picker>

在data 初始化
selectedIndex: 0,
messagess: ['本日', '本周', '本月', '本季度', '上季度', '本年', '去年']

methods:{

handlePickerChange (e) {
  console.log(e.mp.detail.value) //*
this.selectedIndex = e.mp.detail.value
}
}

 



分类:

技术点:

相关文章:

  • 2022-12-23
  • 2019-12-24
  • 2021-11-08
  • 2021-08-02
  • 2021-12-05
  • 2021-11-02
猜你喜欢
  • 2021-04-08
  • 2021-10-15
  • 2019-02-27
  • 2021-10-05
  • 2022-12-23
  • 2022-01-02
相关资源
相似解决方案