Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ubrorg/card

Package Overview
Dependencies
Maintainers
10
Versions
198
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ubrorg/card

card

  • 0.6.1
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
10
Weekly downloads
 
Created
Source

在页面的 page.json 中配置:

{
  "usingComponents": {
    "card": "@ubrorg/card/lib/index"
  }
}

在页面的 page.axml 中使用:

<view class="card-wrapper" a:for="{{items}}">
    <card
      title="abc"
      index="{{index}}"
      onLikeTap="handleLikeTap"
      dataItem="{{item}}"
    >
    </card>
  </view>

在页面中声明 handleLikeTap 方法处理喜欢状态:

Page({
  handleLikeTap(e){
    const { index } = e.target.dataset;
    const {items} = this.data
    items[index].favoriteStatus= !items[index].favoriteStatus
    this.setData({
      items
    })
  },
});

option参数

可直接传dataItem="{{item}}" 也可使用具体属性去覆盖data里的属性值

属性类型默认值解释
typestringlarge卡片类型
backgroupImgUrlstringnull头图
projectNamestring''卡片名称
descriptionstring''描述
extrastring''附加描述
projectTagstring''图标
favoriteStatusbooleanfalse是否喜欢
showLikebooleantrue是否展示喜欢图标
indexstringnull列表索引
cardTagNamestringnull标签
projectTypeNamestring''分类类型
  • type 可选值

    • large
    • small
    • scenic
    • goods
  • icontagType 可选值

    • activity
    • quick
    • hot
    • hotel

开发

  1. yarn 或者 ayarn阿里内网)安装依赖
  2. 小程序 IDE 打开组件(下载地址

更多命令

  • miapp newbranch: 新建分支
  • miapp push: 提交代码
  • miapp prepub: 预发(发布 beta 版本)
  • miapp publish: 正式发布

FAQs

Package last updated on 21 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc