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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@retailwe/ui-good-card

v0.0.23

Published

## 引入

Downloads

21

Readme

Card 商品卡片

引入

app.jsonindex.json中引入组件,详细介绍见快速上手

"usingComponents": {
  "wr-goods-card": "@retailwe/ui-good-card/index"
}

代码演示

基础用法

<wr-goods-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="{{ imageURL }}"
/>

高级用法

可以通过插槽添加定制内容

<wr-goods-card
  num="2"
  tag="标签"
  price="10.00"
  desc="描述信息"
  title="商品标题"
  thumb="{{ imageURL }}"
>
  <view slot="footer">
    <button size="mini">按钮</button>
    <button size="mini">按钮</button>
  </view>
</wr-goods-card>

API

Props

| 参数 | 说明 | 类型 | 默认值 | 说明 | |-----------|-----------|-----------|-------------|-------------| | thumb | 左侧图片 | string | - | - | | thumb-mode | 左侧图片裁剪、缩放的模式,可选值参考小程序 image 组件 mode 属性值 | string | aspectFit | - | | title | 标题 | string | - | - | | desc | 描述 | string | - | - | | tag | 标签 | string | - | - | | num | 商品数量 | string | number | - | - | | price | 商品价格 | string | number | - | - | | price-fill | 价格是否保持两位小数 | boolean | true | - | | origin-price | 商品划线原价 | string | number | - | - | | layout | 图文布局 | string | horizontal | 横向-horizontal、纵向-vertical | | centered | 内容是否垂直居中 | string | false | - | | currency | 货币符号 | string | ¥ | - | | thumb-link | 点击左侧图片后跳转的链接地址 | string | - | - | | link-type | 链接跳转类型,可选值为 redirectTo switchTab reLaunch | string | navigateTo | - | | lazy-load | 是否开启图片懒加载 | boolean | false | - |

Slot

| 名称 | 说明 | |-----------|-----------| | title | 自定义标题栏,如果设置了title属性则不生效 | | desc | 自定义描述栏,如果设置了desc属性则不生效 | | thumb | 自定义 thumb,如果设置了thumb属性则不生效 | | bottom | 自定义价格下方区域 | | footer | 自定义 footer | | tags | 自定义 tags |

Events

| Event | Description | Arguments | | ------ | ----------------------------- | --------- | | clickThumb | 点击商品图片触发 | - |

外部样式类

| 类名 | 说明 | |-----------|-----------| | card-class | 根节点样式类 | | thumb-class | 左侧图片样式类 | | title-class | 标题样式类 | | price-class | 价格样式类 | | origin-price-class | 划线原价样式类 | | desc-class | 描述样式类 | | specs-class | 规格样式类 | | num-class | 数量样式类 |