lighting-ui
Version:
A rich interaction, lightweight, high performance UI library based on Weex
51 lines (39 loc) • 1.76 kB
Markdown
# lc-button
> Basic button with 5 built-in types, supports custom style
## [Demo](https://h5.m.taobao.com/trip/wx-detection-demo/button/index.html?_wx_tpl=https%3A%2F%2Fh5.m.taobao.com%2Ftrip%2Fwx-detection-demo%2Fbutton%2Findex.weex.js)
<img src="https://img.alicdn.com/tfs/TB1aMRGhgvD8KJjy0FlXXagBFXa-562-1000.gif" width="240"/> <img src="https://img.alicdn.com/tfs/TB1b0tMhf6H8KJjy0FjXXaXepXa-200-200.png" width="160"/>
## Code Example
```vue
<template>
<lc-button text="Confirm"
@LcButtonClicked="LcButtonClicked"></lc-button>
</template>
<script>
import { LcButton } from 'weex-ui'
export default {
components: { LcButton },
methods: {
LcButtonClicked (e) {
console.log(e)
}
}
}
</script>
```
More details can be found in [here](https://github.com/alibaba/weex-ui/blob/master/button/loading/index.vue)
### API
| Prop | Type | Required | Default | Description |
| ---- |:----:|:---:|:-------:| :----------:|
| **`text`** | `string` | `Y` | `-` | the text of button |
| **`type`** | `enum` | `N` | `red` | can be set to `normal`/ `highlight`/`red`/`yellow` |
| **`disabled`** | `bool` | `N` | `false` | set disabled(*1) |
| **`btnStyle`** | `object` | `N` | `{}` | custom style about button(*2) |
| **`textStyle`** | `object` | `N` | `{}` | custom style about text (*3) |
- *1:`disabled` will override the default style.
- *2:Detailed style can be referenced [here](https://github.com/alibaba/weex-ui/blob/master/packages/lc-button/type.js)
- *3:Detailed style can be referenced [here](https://github.com/alibaba/weex-ui/blob/master/packages/lc-button/type.js)
### Event
```
// `@LcButtonClicked="LcButtonClicked"`
will return e, type, disabled
```