mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
* style: badge上标大小改变更加灵活 * style: panel-title的行高跟随字号 * style: 绝对定位的元素width或height为auto,left,right,top,bottom不为auto时,auto的margin将计算为0,同初始值 * style: 修复作为组件使用时dialog的定位问题 * style: 修正示例 * style: add * style: capsule * style: modify readme * style: add noticebar * style: modify readme * style: noticebar优化 * style: add popup * style: remove * style: 左右反了... * style: 通告栏支持同一页面多个 * style: 独立管理不同noticebar的动画数据 * style: add * style: 删除多余文件 * style: capsule自定义颜色 * 修复capsule的样式问题
Capsule 胶囊
使用指南
在 app.wxss 中引入组件库所有样式
@import "path/to/zanui-weapp/dist/index.wxss";
在需要使用的模板里引入组件库模板
<import src="path/to/zanui-weapp/dist/capsule/index.wxml" />
代码演示
基础用法
可以用 leftText 和 rightText 控制左右文案
<template is="capsule" data="{{ leftText: '1折', rightText: '限购一份'}}" />
使用不同类型胶囊
按钮支持额外的三种类型 primary, danger, warn
<template is="capsule" data="{{ leftText: '1折', rightText: '限购一份', type: 'danger' }}" />
自定义颜色
通过 color 熟悉,可以自定义显示的颜色
<template is="capsule" data="{{ leftText: '1折', rightText: '限购一份', color: '#38f' }}" />