mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
parent
5a6526922f
commit
2a6916be2d
@ -1,3 +1,5 @@
|
|||||||
|
<wxs src="./index.wxs" module="getOptionText" />
|
||||||
|
|
||||||
<view
|
<view
|
||||||
class="van-picker-column custom-class"
|
class="van-picker-column custom-class"
|
||||||
style="height: {{ itemHeight * visibleItemCount }}px"
|
style="height: {{ itemHeight * visibleItemCount }}px"
|
||||||
@ -18,14 +20,3 @@
|
|||||||
>{{ getOptionText(option, valueKey) }}</view>
|
>{{ getOptionText(option, valueKey) }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<wxs module="getOptionText">
|
|
||||||
function isObj(x) {
|
|
||||||
var type = typeof x;
|
|
||||||
return x !== null && (type === 'object' || type === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = function (option, valueKey) {
|
|
||||||
return isObj(option) && option[valueKey] ? option[valueKey] : option;
|
|
||||||
}
|
|
||||||
</wxs>
|
|
||||||
|
8
packages/picker-column/index.wxs
Normal file
8
packages/picker-column/index.wxs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
function isObj(x) {
|
||||||
|
var type = typeof x;
|
||||||
|
return x !== null && (type === 'object' || type === 'function');
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function (option, valueKey) {
|
||||||
|
return isObj(option) && option[valueKey] != null ? option[valueKey] : option;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user