1.5.1 • Published 1 year ago

@wines/card v1.5.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@wines/card

Card 卡片

用于组织信息和操作,通常也作为详细信息的入口。

使用指南

在 page.json 中引入组件

{
  "navigationBarTitleText": "Card",
  "usingComponents": {
    "wux-card": "@wines/card",
    "wux-wing-blank": "@wines/wing-blank"
  }
}

示例

<view class="page">
	<view class="page__hd">
		<view class="page__title">Card</view>
		<view class="page__desc">卡片</view>
	</view>
	<view class="page__bd">
		<view class="sub-title">Default</view>
		<wux-wing-blank size="default">
			<wux-card title="卡片标题" extra="额外内容">
				<view slot="body">卡片内容</view>
				<view slot="footer">尾部内容</view>
			</wux-card>
		</wux-wing-blank>
		<view class="sub-title">Thumb</view>
		<wux-wing-blank size="default">
			<wux-card title="卡片标题" extra="额外内容" thumb="http://cdn.skyvow.cn/logo.png">
				<view slot="body">卡片内容</view>
				<view slot="footer">尾部内容</view>
			</wux-card>
		</wux-wing-blank>
		<view class="sub-title">Custom thumb style</view>
		<wux-wing-blank size="default">
			<wux-card
			 title="卡片标题"
			 extra="额外内容"
			 thumb="http://cdn.skyvow.cn/logo.png"
			 thumb-style="border-radius: 50%;"
			>
				<view slot="body">卡片内容</view>
				<view slot="footer">尾部内容</view>
			</wux-card>
		</wux-wing-blank>
		<view class="sub-title">No border</view>
		<wux-wing-blank size="default">
			<wux-card
			 bordered="{{ false }}"
			 title="卡片标题"
			 extra="额外内容"
			 thumb="http://cdn.skyvow.cn/logo.png"
			>
				<view slot="body">卡片内容</view>
				<view slot="footer">尾部内容</view>
			</wux-card>
		</wux-wing-blank>
		<view class="sub-title">Full</view>
		<wux-card
		 full
		 title="卡片标题"
		 extra="额外内容"
		 thumb="http://cdn.skyvow.cn/logo.png"
		>
			<view slot="body">卡片内容</view>
			<view slot="footer">尾部内容</view>
		</wux-card>
		<view class="sub-title">Actions</view>
		<wux-card
		 full
		 title="付款金额"
		 extra="¥1024.00"
		 actions="{{ actions }}"
		 bind:action="onAction"
		>
			<view slot="body">商品:电动打蛋机</view>
			<view slot="footer">状态:未支付</view>
		</wux-card>
	</view>
</view>
Page({
  data: {
    actions: [
      {
        type: 'default',
        text: '微信支付',
      },
      {
        text: '现金支付',
        type: 'primary',
      },
    ],
  },
  onAction(e) {
    console.log('onAction', e.detail);
  },
});

API

Card props

参数类型描述默认值
prefixClsstring自定义类名前缀wux-card
borderedboolean是否有边框true
fullboolean是否通栏false
titlestring卡片标题-
thumbstring卡片标题图片-
thumbStylestring,object标题图片样式-
extrastring卡片标题辅助内容-
actionsarray操作按钮[]
actions[].textstring按钮的文本-
actions[].typestring按钮的类型,可选值为 default、primary-
actions[].boldboolean是否加粗按钮的文字-
actions[].disabledboolean是否禁用false
bind:actionfunction操作按钮的点击事件-

Card slot

名称描述
extra自定义辅助内容
body自定义内容
footer自定义尾部内容

Card externalClasses

名称描述
wux-class根节点样式类
1.5.1

1 year ago

1.5.0

1 year ago

1.3.5

2 years ago

1.4.0

2 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago