mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[Improvement] add utils (#416)
This commit is contained in:
parent
dcb2cfb824
commit
10f157adbb
@ -1,14 +1,8 @@
|
|||||||
import config from '../../config';
|
import list from '../../config';
|
||||||
import Page from '../../common/page';
|
import Page from '../../common/page';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
list: config
|
list
|
||||||
},
|
|
||||||
|
|
||||||
onShareAppMessage() {
|
|
||||||
return {
|
|
||||||
title: 'Vant Weapp 组件库演示'
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -39,7 +39,7 @@ Search 支持自定义右侧取消按钮,使用名字为 action 的 slot 即
|
|||||||
use-action-slot
|
use-action-slot
|
||||||
@search="onSearch"
|
@search="onSearch"
|
||||||
>
|
>
|
||||||
<view slot="action" @click="onSearch">搜索</view>
|
<view slot="action" bind:tap="onSearch">搜索</view>
|
||||||
</van-search>
|
</van-search>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
13
packages/utils/index.js
Normal file
13
packages/utils/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
function isDef(value) {
|
||||||
|
return value !== undefined && value !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isObj(x) {
|
||||||
|
const type = typeof x;
|
||||||
|
return x !== null && (type === 'object' || type === 'function');
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
isObj,
|
||||||
|
isDef
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user