npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@retailwe/ui-cell

v0.0.22

Published

## 引入

Readme

cell 单元格

引入

全局引入,在miniprogram根目录下的app.json中配置,局部引入,在需要引入的页面或组件的index.json中配置。

// app.json 或 index.json
"usingComponents": {
  "wr-cell": "@retailwe/ui-cell/index"
}

代码演示

基础用法

cell可以单独使用,也可以与cell-group搭配使用。cell-group可以为cell提供上下外边框。

<wr-cell-group>
  <wr-cell title="单元格" value="内容" />
  <wr-cell title="单元格" value="内容" label="描述信息" border="{{ false }}" />
</wr-cell-group>

单元格大小

通过size属性可以控制单元格的大小

<wr-cell title="单元格" value="内容" size="large" />
<wr-cell title="单元格" value="内容" size="large" label="描述信息" />

展示图标

通过icon属性在标题左侧展示图标

<wr-cell title="单元格" icon="location-o" />

展示箭头

设置is-link属性后会在单元格右侧显示箭头,并且可以通过arrow-direction属性控制箭头方向

<wr-cell title="单元格" is-link />
<wr-cell title="单元格" is-link value="内容" />
<wr-cell title="单元格" is-link value="内容" arrow-direction="down" />

页面跳转

可以通过url属性进行页面跳转,通过link-type属性控制跳转类型

<wr-cell
  is-link
  title="单元格"
  link-type="navigateTo"
  url="/pages/dashboard/index"
/>

分组标题

通过cell-grouptitle属性可以指定分组标题

<wr-cell-group title="分组1">
  <wr-cell title="单元格" value="内容" />
</wr-cell-group>
<wr-cell-group title="分组2">
  <wr-cell title="单元格" value="内容" />
</wr-cell-group>

使用插槽

如以上用法不能满足你的需求,可以使用插槽来自定义内容

<wr-cell value="内容" icon="shop-o" is-link>
  <view slot="title">
    <view class="wr-cell-text">单元格</view>
    <wr-tag type="danger">标签</wr-tag>
  </view>
</wr-cell>
<wr-cell title="单元格">
  <wr-icon slot="right-icon" name="search" class="custom-icon" />
</wr-cell>

垂直居中

通过center属性可以让cell的左右内容都垂直居中

<wr-cell center title="单元格" value="内容" label="描述信息" />

API

cell-group Props

| 参数 | 说明 | 类型 | 默认值 | 版本 | |-----------|-----------|-----------|-------------|-------------| | title | 分组标题 | string | - | - | | border | 是否显示外边框 | boolean | true | - |

cell-group 外部样式类

| 类名 | 说明 | |-----------|-----------| | wr-class | 根节点样式类 |

cell Props

| 参数 | 说明 | 类型 | 默认值 | 版本 | |-----------|-----------|-----------|-------------|-------------| | icon | 左侧图标名称或图片链接,可用 icon 见 icon 组件预览页 | string | - | - | | title | 左侧标题 | string | number | - | | title-width | 标题宽度,须包含单位 | string | - | - | | value | 右侧内容 | string | number | - | - | | label | 标题下方的描述信息 | string | - | - | | size | 单元格大小,可选值为 large | string | - | - | | border | 是否显示下边框 | boolean | true | - | | center | 是否使内容垂直居中 | boolean | false | - | | url | 点击后跳转的链接地址 | string | - | - | | link-type | 链接跳转类型,可选值为 redirectTo switchTab reLaunch | string | navigateTo | - | | clickable | 是否开启点击反馈 | boolean | false | - | | is-link | 是否展示右侧箭头并开启点击反馈 | boolean | false | - | | required | 是否显示表单必填星号 | boolean | false | - | | arrow-direction | 箭头方向,可选值为 left up down | string | - | - | | use-label-slot | 是否使用 label slot | boolean | false | - | | iconColor | icon颜色 | String | ‘’ | - | - | | iconSize | icon大小 | Number | 24 | - |

cell Event

| 事件名 | 说明 | 参数 | |-----------|-----------|-----------| | bind:click | 点击单元格时触发 | - |

cell Slot

| 名称 | 说明 | |-----------|-----------| | - | 自定义value显示内容,如果设置了value属性则不生效 | | title | 自定义title显示内容,如果设置了title属性则不生效 | | label | 自定义label显示内容,需要设置 use-label-slot属性 | | icon | 自定义icon显示内容,如果设置了icon属性则不生效 | | right-icon | 自定义右侧按钮,默认是arrow,如果设置了is-link属性则不生效 |