Weex 按钮组件,支持 4 种基本类型 button,可自定义样式
!> 在 weex-ui
0.6.0 版本以上,我们对 type
api 有对应修改,同时新增 size
api 用于设置大小。
<template> <wxc-button text="确定" @wxcButtonClicked="wxcButtonClicked"></wxc-button> </template> <script> import { WxcButton } from 'weex-ui' export default { components: { WxcButton }, methods: { wxcButtonClicked (e) { console.log(e) } } } </script>
更详细代码可以参考 这里
Prop | Type | Required | Default | Description |
---|---|---|---|---|
text | String | Y | - | 展现的文字 |
type | String | N | red | 类型:white /red /yellow /blue /green |
size | String | N | full | 类型:full /big /medium /small |
disabled | Boolean | N | false | 是否 disabled(注1) |
isHighlight | Boolean | N | false | 是否高亮显示 |
btnStyle | Object | N | {} | 按钮的样式对象(注2) |
textStyle | Object | N | {} | 文字的样式对象(注3) |
// `@wxcButtonClicked="wxcButtonClicked"` 将会返回 e, type, disabled