提交 e62278f8 编写于 作者: W WOSHIMAHAIFENG

调整disable切换样式的顺序

上级 c4111b94
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
</script> </script>
<template> <template>
<scroll-view direction="vertical" style="flex:1"> <scroll-view direction="vertical" style="flex:1">
<view class="main"> <view class="main">
<!--type--> <!--type-->
<view class="container"> <view class="container">
...@@ -105,48 +105,50 @@ ...@@ -105,48 +105,50 @@
plain-false plain-false
</button> </button>
</view> </view>
<!--disable-->
<view class="container"> </view>
<button style="margin: 10px;" :disabled="false" :size="size_enum[size_enum_current].name" <view class="container">
:type="type_enum[type_enum_current].name" :plain="plain_boolean" @click="button_click" <button style="margin: 10px;position: relative;text-align:left;padding:5px;color: #ffffff;background-color: #1AAD19;
@touchstart="button_touchstart" @touchmove="button_touchmove" @touchcancel="button_touchcancel"
@touchend="button_touchend" @tap="button_tap" @longpress="button_longpress" class="btn"
:class="default_style ? 'custom-btn' : ''" :hover-class="default_style ? 'is-hover' : 'button-hover'">
disable-false
</button>
</view>
<view class="container">
<button style="margin: 10px;" :disabled="true" :size="size_enum[size_enum_current].name"
:type="type_enum[type_enum_current].name" :plain="plain_boolean" @click="button_click"
@touchstart="button_touchstart" @touchmove="button_touchmove" @touchcancel="button_touchcancel"
@touchend="button_touchend" @tap="button_tap" @longpress="button_longpress" class="btn"
:class="default_style ? 'custom-btn' : ''" :hover-class="default_style ? 'is-hover' : 'button-hover'">
disable-true
</button>
</view>
<view class="container">
<button style="margin: 10px;position: relative;text-align:left;padding:5px;color: #ffffff;background-color: #1AAD19;
font-size: 10px;line-height: 2;" :disabled="disabled_boolean"> font-size: 10px;line-height: 2;" :disabled="disabled_boolean">
custom-btn custom-btn
</button> </button>
</view> </view>
<view class="container"> <view class="container">
<button style="margin: 10px; <button style="margin: 10px;
font-size: 15px;color: red;" type="warn" plain="true" :disabled="disabled_boolean"> font-size: 15px;color: red;" type="warn" plain="true" :disabled="disabled_boolean">
custom-btn-plain-warn custom-btn-plain-warn
</button> </button>
</view> </view>
<view class="content"> <view class="content">
<button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean">uni-app x</button> <button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean"
<button style="margin: 10px;" type="primary" hover-class="none">hover-class none</button>
@tap="change_disabled_boolean(!disabled_boolean)">修改disabled为{{!disabled_boolean}}</button> </view>
</view>
<view class="content">
<button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean" hover-class="none">hover-class none</button>
</view>
</view> <view class="content">
</scroll-view> <button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean">uni-app x</button>
<button style="margin: 10px;" type="primary"
@tap="change_disabled_boolean(!disabled_boolean)">修改disabled为{{!disabled_boolean}}</button>
</view>
<!--disable-->
<view class="container">
<button style="margin: 10px;" :disabled="false" :size="size_enum[size_enum_current].name"
:type="type_enum[type_enum_current].name" :plain="plain_boolean" @click="button_click"
@touchstart="button_touchstart" @touchmove="button_touchmove" @touchcancel="button_touchcancel"
@touchend="button_touchend" @tap="button_tap" @longpress="button_longpress" class="btn"
:class="default_style ? 'custom-btn' : ''" :hover-class="default_style ? 'is-hover' : 'button-hover'">
disable-false
</button>
</view>
<view class="container">
<button style="margin: 10px;" :disabled="true" :size="size_enum[size_enum_current].name"
:type="type_enum[type_enum_current].name" :plain="plain_boolean" @click="button_click"
@touchstart="button_touchstart" @touchmove="button_touchmove" @touchcancel="button_touchcancel"
@touchend="button_touchend" @tap="button_tap" @longpress="button_longpress" class="btn"
:class="default_style ? 'custom-btn' : ''" :hover-class="default_style ? 'is-hover' : 'button-hover'">
disable-true
</button>
</view>
</scroll-view>
</template> </template>
<style> <style>
...@@ -180,16 +182,17 @@ ...@@ -180,16 +182,17 @@
.container { .container {
width: 100%; width: 100%;
height: 60px; height: 60px;
} }
.is-hover {
color: rgba(255, 255, 255, 0.6); .is-hover {
background-color: #179b16; color: rgba(255, 255, 255, 0.6);
border-color: #179b16; background-color: #179b16;
} border-color: #179b16;
}
.button-hover {
color: rgba(0, 0, 0, 0.6); .button-hover {
background-color: #dedede; color: rgba(0, 0, 0, 0.6);
} background-color: #dedede;
}
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册