mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-05 19:41:45 +08:00
test(Cell): add demo test
This commit is contained in:
parent
e14ca0b257
commit
f88aaf114c
@ -72,6 +72,7 @@
|
||||
"van-card": "./dist/card/index",
|
||||
"van-card-demo": "./dist/card/demo/index",
|
||||
"van-cell": "./dist/cell/index",
|
||||
"van-cell-demo": "./dist/cell/demo/index",
|
||||
"van-cell-group": "./dist/cell-group/index",
|
||||
"van-checkbox": "./dist/checkbox/index",
|
||||
"van-checkbox-group": "./dist/checkbox-group/index",
|
||||
|
@ -1,97 +1 @@
|
||||
<demo-block title="基础用法">
|
||||
<van-cell-group>
|
||||
<van-cell title="单元格" value="内容" />
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
label="描述信息"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="卡片风格">
|
||||
<van-cell-group inset>
|
||||
<van-cell title="单元格" value="内容" />
|
||||
<van-cell title="单元格" value="内容" label="描述信息" />
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="单元格大小">
|
||||
<van-cell-group>
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
size="large"
|
||||
/>
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
size="large"
|
||||
use-label-slot
|
||||
border="{{ false }}"
|
||||
>
|
||||
<view slot="label">描述信息</view>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="展示图标">
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
icon="location-o"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="展示箭头">
|
||||
<van-cell title="单元格" is-link />
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
is-link
|
||||
/>
|
||||
<van-cell
|
||||
title="单元格"
|
||||
is-link
|
||||
arrow-direction="down"
|
||||
value="内容"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="页面跳转">
|
||||
<van-cell title="单元格" is-link url="/pages/dashboard/index" />
|
||||
<van-cell title="单元格" is-link url="/pages/dashboard/index" link-type="redirectTo" />
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="分组标题">
|
||||
<van-cell-group title="分组 1">
|
||||
<van-cell title="单元格" value="内容" />
|
||||
</van-cell-group>
|
||||
<van-cell-group title="分组 2">
|
||||
<van-cell title="单元格" value="内容" />
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="使用插槽">
|
||||
<van-cell value="内容" icon="shop-o" is-link>
|
||||
<view slot="title">
|
||||
<view class="title">单元格</view>
|
||||
<van-tag type="danger">标签</van-tag>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell title="单元格" border="{{ false }}">
|
||||
<van-icon slot="right-icon" name="search" />
|
||||
</van-cell>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="垂直居中">
|
||||
<van-cell
|
||||
center
|
||||
title="单元格"
|
||||
value="内容"
|
||||
label="描述信息"
|
||||
/>
|
||||
</demo-block>
|
||||
<van-cell-demo />
|
||||
|
10
packages/cell/demo/index.json
Normal file
10
packages/cell/demo/index.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-cell": "../../cell/index",
|
||||
"van-cell-group": "../../cell-group/index",
|
||||
"van-icon": "../../icon/index",
|
||||
"van-tag": "../../tag/index",
|
||||
"demo-block": "../../../example/components/demo-block/index"
|
||||
}
|
||||
}
|
5
packages/cell/demo/index.ts
Normal file
5
packages/cell/demo/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { VantComponent } from '../../common/component';
|
||||
|
||||
VantComponent({
|
||||
data: {},
|
||||
});
|
97
packages/cell/demo/index.wxml
Normal file
97
packages/cell/demo/index.wxml
Normal file
@ -0,0 +1,97 @@
|
||||
<demo-block title="基础用法">
|
||||
<van-cell-group>
|
||||
<van-cell title="单元格" value="内容" />
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
label="描述信息"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="卡片风格">
|
||||
<van-cell-group inset>
|
||||
<van-cell title="单元格" value="内容" />
|
||||
<van-cell title="单元格" value="内容" label="描述信息" />
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="单元格大小">
|
||||
<van-cell-group>
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
size="large"
|
||||
/>
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
size="large"
|
||||
use-label-slot
|
||||
border="{{ false }}"
|
||||
>
|
||||
<view slot="label">描述信息</view>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="展示图标">
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
icon="location-o"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="展示箭头">
|
||||
<van-cell title="单元格" is-link />
|
||||
<van-cell
|
||||
title="单元格"
|
||||
value="内容"
|
||||
is-link
|
||||
/>
|
||||
<van-cell
|
||||
title="单元格"
|
||||
is-link
|
||||
arrow-direction="down"
|
||||
value="内容"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="页面跳转">
|
||||
<van-cell title="单元格" is-link url="/pages/dashboard/index" />
|
||||
<van-cell title="单元格" is-link url="/pages/dashboard/index" link-type="redirectTo" />
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="分组标题">
|
||||
<van-cell-group title="分组 1">
|
||||
<van-cell title="单元格" value="内容" />
|
||||
</van-cell-group>
|
||||
<van-cell-group title="分组 2">
|
||||
<van-cell title="单元格" value="内容" />
|
||||
</van-cell-group>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="使用插槽">
|
||||
<van-cell value="内容" icon="shop-o" is-link>
|
||||
<view slot="title">
|
||||
<view class="title">单元格</view>
|
||||
<van-tag type="danger">标签</van-tag>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell title="单元格" border="{{ false }}">
|
||||
<van-icon slot="right-icon" name="search" />
|
||||
</van-cell>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="垂直居中">
|
||||
<van-cell
|
||||
center
|
||||
title="单元格"
|
||||
value="内容"
|
||||
label="描述信息"
|
||||
/>
|
||||
</demo-block>
|
627
packages/cell/test/__snapshots__/demo.spec.ts.snap
Normal file
627
packages/cell/test/__snapshots__/demo.spec.ts.snap
Normal file
@ -0,0 +1,627 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should render demo and match snapshot 1`] = `
|
||||
<main>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
基础用法
|
||||
</wx-view>
|
||||
<van-cell-group>
|
||||
<wx-view
|
||||
class="custom-class van-cell-group van-hairline--top-bottom"
|
||||
>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--borderless"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
<wx-view
|
||||
class="van-cell__label label-class"
|
||||
>
|
||||
描述信息
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</van-cell-group>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
卡片风格
|
||||
</wx-view>
|
||||
<van-cell-group>
|
||||
<wx-view
|
||||
class="custom-class van-cell-group van-cell-group--inset van-hairline--top-bottom"
|
||||
>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
<wx-view
|
||||
class="van-cell__label label-class"
|
||||
>
|
||||
描述信息
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</van-cell-group>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
单元格大小
|
||||
</wx-view>
|
||||
<van-cell-group>
|
||||
<wx-view
|
||||
class="custom-class van-cell-group van-hairline--top-bottom"
|
||||
>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--large"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--large van-cell--borderless"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
<wx-view
|
||||
class="van-cell__label label-class"
|
||||
>
|
||||
<wx-view
|
||||
slot="label"
|
||||
>
|
||||
描述信息
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</van-cell-group>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
展示图标
|
||||
</wx-view>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--borderless"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<van-icon
|
||||
class="van-cell__left-icon-wrap"
|
||||
customClass="van-cell__left-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-location-o"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
展示箭头
|
||||
</wx-view>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--clickable"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
/>
|
||||
<van-icon
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
customClass="van-cell__right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-arrow"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--clickable"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
<van-icon
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
customClass="van-cell__right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-arrow"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--borderless van-cell--clickable"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
<van-icon
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
customClass="van-cell__right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-arrow-down"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
页面跳转
|
||||
</wx-view>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--clickable"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
/>
|
||||
<van-icon
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
customClass="van-cell__right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-arrow"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--clickable"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
/>
|
||||
<van-icon
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
customClass="van-cell__right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-arrow"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
分组标题
|
||||
</wx-view>
|
||||
<van-cell-group>
|
||||
<wx-view
|
||||
class="van-cell-group__title"
|
||||
>
|
||||
|
||||
分组 1
|
||||
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="custom-class van-cell-group van-hairline--top-bottom"
|
||||
>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</van-cell-group>
|
||||
<van-cell-group>
|
||||
<wx-view
|
||||
class="van-cell-group__title"
|
||||
>
|
||||
|
||||
分组 2
|
||||
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="custom-class van-cell-group van-hairline--top-bottom"
|
||||
>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</van-cell-group>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
使用插槽
|
||||
</wx-view>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--clickable"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<van-icon
|
||||
class="van-cell__left-icon-wrap"
|
||||
customClass="van-cell__left-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-shop-o"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
<wx-view
|
||||
slot="title"
|
||||
>
|
||||
<wx-view
|
||||
class="title"
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<van-tag>
|
||||
<wx-view
|
||||
class="custom-class van-tag van-tag--danger"
|
||||
style=""
|
||||
>
|
||||
标签
|
||||
</wx-view>
|
||||
</van-tag>
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
<van-icon
|
||||
class="van-cell__right-icon-wrap right-icon-class"
|
||||
customClass="van-cell__right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-arrow"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--borderless"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
/>
|
||||
<van-icon
|
||||
slot="right-icon"
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-search"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
<demo-block>
|
||||
<wx-view
|
||||
class="custom-class demo-block van-clearfix "
|
||||
>
|
||||
<wx-view
|
||||
class="demo-block__title"
|
||||
>
|
||||
垂直居中
|
||||
</wx-view>
|
||||
<van-cell>
|
||||
<wx-view
|
||||
class="custom-class van-cell van-cell--center"
|
||||
hoverClass="van-cell--hover hover-class"
|
||||
hoverStayTime="70"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<wx-view
|
||||
class="van-cell__title title-class"
|
||||
style=""
|
||||
>
|
||||
单元格
|
||||
<wx-view
|
||||
class="van-cell__label label-class"
|
||||
>
|
||||
描述信息
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
<wx-view
|
||||
class="van-cell__value value-class"
|
||||
>
|
||||
内容
|
||||
</wx-view>
|
||||
</wx-view>
|
||||
</van-cell>
|
||||
</wx-view>
|
||||
</demo-block>
|
||||
</main>
|
||||
`;
|
11
packages/cell/test/demo.spec.ts
Normal file
11
packages/cell/test/demo.spec.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import path from 'path';
|
||||
import simulate from 'miniprogram-simulate';
|
||||
|
||||
test('should render demo and match snapshot', () => {
|
||||
const id = simulate.load(path.resolve(__dirname, '../demo/index'), {
|
||||
rootPath: path.resolve(__dirname, '../../'),
|
||||
});
|
||||
const comp = simulate.render(id);
|
||||
comp.attach(document.createElement('parent-wrapper'));
|
||||
expect(comp.toJSON()).toMatchSnapshot();
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user