mpvue-vant icon indicating copy to clipboard operation
mpvue-vant copied to clipboard

DatetimePicker组件其中有个属性formatter需要传个function,在methods中定义无效

Open jy05568536 opened this issue 5 years ago • 4 comments

jy05568536 avatar May 10 '19 08:05 jy05568536

请问该问题解决了吗?能否提供复现路径呢?

Rychou avatar May 29 '19 15:05 Rychou

<!-- 日期选择 -->
<van-popup :show="timeShow" position="bottom" @close="timeShow=false">
      <van-datetime-picker :value="date" show-toolbar title="请选择日期"
                           @confirm="onPick" @cancel="timeShow=false" @formatter="formatter"/>
</van-popup>

methods中定义了formatter的方法,渲染的时候直接就报找不到formatter fucntion

jy05568536 avatar May 30 '19 07:05 jy05568536

:formatter="formatter" 然后写在data里面虽然报错但是可以用 data() { return { formatter(type, value) { if (type === 'year') { return ${value}年; } else if (type === 'month') { return ${value}月; } else if (type === 'day') { return ${value}日; } else if (type === 'hour') { return ${value}时; } else if (type === 'minute') { return ${value}分; } }, .....

liuyaochen04 avatar Jul 04 '19 04:07 liuyaochen04

checkbox 搭配单元格组件使用 <van-checkbox-group value="{{ result }}" bind:change="onChange"> <van-cell-group > <van-cell wx:for="{{ list }}" wx:key="index" title="复选框 {{ item }}" value-class="value-class" clickable data-index="{{ index }}" bind:click="toggle" > <van-checkbox catch:tap="noop" class="checkboxes-{{ index }}" name="{{ item }}" /> </van-cell> </van-cell-group> </van-checkbox-group>

class="checkboxes-{{ index }} 这个在mpvue 怎么写呀 @jy05568536 @Rychou

liuyaochen04 avatar Jul 04 '19 04:07 liuyaochen04