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-specs-goods-card

v0.0.34

Published

## 引入

Downloads

34

Readme

SpecsGoodsCard 带已选规格的商品卡片

引入

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

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

代码演示

基础用法

该组件基于components\goods-card组件,透传components\goods-card的所有参数,可替代使用。 可参考\we-retail\src\supermarket\components\order-goods-card中的用法。

Page({
  data: {
    /** @type { GoodBase } */
    good: {
      thumb: '123123',
      num: 3,
      title: '当季新裤',
      desc: '欧美网红款',
      specs: ['比利时进口', 'L - 180', '长袖', '天蓝'],
      tags: ['双十一', '裤子'],
      price: 20.1 * 100,
      originPrice: 45.2 * 100,

      /** 指定某个key不展示 */
      hideKey: {
        thumbTag: true
      }
    }
  }
})
<wr-specs-goods-card data="{{good}}" />

自定义样式

本组件在goods-card的基础上增加了弹框展示。 由于组件中有两处使用goods-card组件,并且样式不同,页面在通过样式覆盖实现自己的样式时,要注意区分。

<wr-specs-goods-card
  class="order-goods-card"
  wx:if="{{!hidden}}"
  data="{{good}}"
></wr-specs-goods-card>
/* 限定样式覆盖范围,避免同时覆盖了组件中的两处`goods-card` */
/* 限定仅覆盖 .order-goods-card > wr-goods-card 下的goods-card样式 */
.order-goods-card > wr-goods-card {
  .wr-goods-card {
    background-color: white;

    &__thumb {
      width: 140rpx;
      height: 140rpx;
      background-color: white;
    }
    // 更多...
  }
}

API

Props

透传goods-card需要的属性的属性,具体参考goods-card的README.md

以下是新增的属性 | 参数 | 说明 | 类型 | 默认值 | 说明 | | disable-popup | 禁止弹框 | boolean | false | - |

Events

透传goods-card的所有事件,具体参考goods-card的README.md 以下是新增的事件 | Event | Description | Arguments | | ------ | ----------------------------- | --------- | | specstap | 点击规格弹框时触发 | - | | specsopen | 打开规格弹框时触发 | - | | specsclose | 关闭规格弹框时触发 | - |

关于样式覆盖

本组件下external.less文件是覆盖弹框中的goods-card样式,页面less必须直接/间接的引入该文件。

外部样式类透传

goods-card所有的外部样式类除了card-class之外都可以透传,card-class被占用了不会透传。