提交 54beea7e 编写于 作者: W wanganxp

x

上级 7add1c2f
......@@ -8,3 +8,51 @@
<!-- UTSCOMJSON.button.reference -->
## button样式修改@style
button组件属性中的size和type,属于预置样式,方便开发者使用。开发者也可以通过style和class来自定义样式。
button虽然可以内嵌text组件,但不建议通过text组件来修改button样式,因为会导致hove-class不生效。尤其是uvue中样式不继承。建议直接在button组件的style或class属性编写样式。
style和class的优先级,高于size和type属性。
```html
<template>
<button size="default" type="default"
style="color:#ffffff;backgroundColor:#1AAD19;borderColor:#1AAD19"
hover-class="is-hover">按钮</button>
</template>
<style>
.is-hover {
color: rgba(255, 255, 255, 0.6);
background-color: #179b16;
border-color: #179b16;
}
</style>
```
## button点击
button 组件的点击遵循 vue 标准的 @click事件。
button 组件没有 url 属性,如果要跳转页面,可以在@click中编写,也可以在button组件外面套一层 navigator 组件。举例,如需跳转到about页面,可按如下几种代码写法执行:
```html
<template>
<view>
<navigator url="/pages/about/about"><button>通过navigator组件跳转到about页面</button></navigator>
<button @click="goto('/pages/about/about')">通过方法跳转到about页面</button>
</view>
</template>
<script>
export default {
methods: {
goto(url:string) {
uni.navigateTo({
url:url
})
}
}
}
</script>
```
......@@ -18,3 +18,5 @@ text组件在web浏览器渲染(含浏览器、小程序webview渲染模式、
<!-- UTSCOMJSON.text.reference -->
## tips
- 选择复制,仅支持全选复制,暂未支持自由调整光标选择文字
\ No newline at end of file
......@@ -194,7 +194,7 @@ uni自带API,如下为目前支持的清单。
* [x] uni-storage的一系列API
### 定位
* [x] uni.getLocation 一期仅支持腾讯定位
* [x] uni.getLocation 一期仅支持系统定位和腾讯定位
### 媒体
* [x] uni.chooseImage 仅支持相册,不支持相机
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册