Coder Social home page Coder Social logo

wx-cards's Introduction

wx-cards

微信小程序卡片类UI组件库

996.icu LICENSE

体验

使用微信扫一扫体验小程序组件示例
image

标准卡片

引入

"usingComponents": {
    "card": "../../dist/card/card"
}

基本用法

<card
    headerImg='/pages/wx-cards/images/head.jpeg'
    title='Mastering Pizza'
    time='September 25, 2019'
    img='/pages/wx-cards/images/pizazz.jpg'
    context='A revolutionary guide to making delicious pizza at home, offering a variety of base doughs so that your pizza will turn out perfect no matter what kind of oven or equipment you have.'
    moreText="Pizza remains America's favorite food, but one that many people hesitate to make at home. In Mastering Pizza, award-winning chef Marc Vetri tackles the topic with his trademark precision, making perfect pizza available to anyone. \n\nThe recipes—gleaned from years spent researching recipes in Italy and perfecting them in America—have a variety of base doughs of different hydration levels, which allow home cooks to achieve the same results with a regular kitchen oven as they would with a professional pizza oven. \n\nThe book covers popular standards like Margherita and Carbonara while also featuring unexpected toppings such as mussels and truffles—and even a dessert pizza made with Nutella. \n\nWith transporting imagery from Italy and hardworking step-by-step photos to demystify the process, Mastering Pizza will help you make pizza as delicious as you find in Italy."
    tag='标签一'
    tagColor='blue'
    isShowLike="{{true}}"
    isLiked="{{false}}"
    likeNumber='{{10}}'
    isShowUnlike="{{true}}"
    isUnLiked="{{false}}"
    unlikeNumber='{{2}}'
    isShowDelete='{{true}}'
    bind:like='handleLike'
    bind:unlike='handleUnlike'
    bind:delete='handleDelete'></card>

属性

属性 说明 类型 默认值
headerImg 头像 string
title 标题 string
time 时间 string
img 主图 string
context 内容 string
tag 标签 string
tagColor 标签颜色,可选blue,yellow,green,red string
isShowLike 是否显示喜欢图标 boolean false
isLiked 喜欢图标颜色,true为红色,false为灰色 boolean false
likeNumber 喜欢数量,如果数量为0则不显示 number
isShowUnlike 是否显示反对图标 boolean false
isUnliked 反对图标颜色,true为蓝色,false为灰色 boolean false
unlikeNumber 反对数量,如果数量为0则不显示 number
isShowDelete 删除图标 boolean false
moreText 更多详情 string

事件

事件 说明 返回值
bind:like 点击喜欢图标触发 第一个参数为this,第二个参数为图标当前状态,true为红色,false为灰色
bind:unlike 点击反对图标触发 第一个参数为this,第二个参数为图标当前状态,true为蓝色,false为灰色
bind:delete 点击删除图标触发

标题卡片

引入

"usingComponents": {
    "title-card": "../../dist/title-card/title-card"
}

基本用法

  <title-card
    img='/pages/wx-cards/images/title-card.jpg'
    title='MidWest Pet'
    context='Secure double latch step-through door access, Exercise Pen / Pet Playpen folds flat for convenient storage'
    isShowBtns='{{true}}'
    isLiked='{{false}}'
    likeNumber='{{30}}'
    bind:like='handleLike'></title-card>

属性

属性 说明 类型 默认值
img 主图 string
title 标题 string
context 内容 string
isShowBtns 是否显示按钮行 boolean true
isLiked 喜欢图标颜色,true为红色,false为黑色 boolean false
likeNumber 喜欢数量,如果是0则不显示 number 0

事件

事件 说明 返回值
bind:like 点击喜欢图标触发

wx-cards's People

Contributors

katherine0325 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.