提交 6f00f494 编写于 作者: D DCloud_LXH

fix: useBooleanAttr

上级 f96cfa22
...@@ -76,13 +76,14 @@ export default /*#__PURE__*/ defineBuiltInComponent({ ...@@ -76,13 +76,14 @@ export default /*#__PURE__*/ defineBuiltInComponent({
useListeners(props, { 'label-click': _onClick }) useListeners(props, { 'label-click': _onClick })
return () => { return () => {
const { booleanAttrs } = useBooleanAttr(props, 'disabled') const booleanAttrs = useBooleanAttr(props, 'disabled')
return ( return (
<uni-checkbox {...booleanAttrs} onClick={_onClick}> <uni-checkbox {...booleanAttrs} onClick={_onClick}>
<div class="uni-checkbox-wrapper"> <div class="uni-checkbox-wrapper">
<div <div
class="uni-checkbox-input" class="uni-checkbox-input"
// @ts-ignore
class={{ 'uni-checkbox-input-disabled': props.disabled }} class={{ 'uni-checkbox-input-disabled': props.disabled }}
> >
{checkboxChecked.value {checkboxChecked.value
......
...@@ -80,7 +80,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({ ...@@ -80,7 +80,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
useListeners(props, { 'label-click': _onClick }) useListeners(props, { 'label-click': _onClick })
return () => { return () => {
const { booleanAttrs } = useBooleanAttr(props, 'disabled') const booleanAttrs = useBooleanAttr(props, 'disabled')
return ( return (
<uni-radio {...booleanAttrs} onClick={_onClick}> <uni-radio {...booleanAttrs} onClick={_onClick}>
......
...@@ -87,7 +87,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({ ...@@ -87,7 +87,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
return () => { return () => {
const { color, type } = props const { color, type } = props
const { booleanAttrs } = useBooleanAttr(props, 'disabled') const booleanAttrs = useBooleanAttr(props, 'disabled')
return ( return (
<uni-switch ref={rootRef} {...booleanAttrs} onClick={_onClick}> <uni-switch ref={rootRef} {...booleanAttrs} onClick={_onClick}>
...@@ -95,6 +95,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({ ...@@ -95,6 +95,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
<div <div
v-show={type === 'switch'} v-show={type === 'switch'}
class="uni-switch-input" class="uni-switch-input"
// @ts-ignore
class={[switchChecked.value ? 'uni-switch-input-checked' : '']} class={[switchChecked.value ? 'uni-switch-input-checked' : '']}
style={{ style={{
backgroundColor: switchChecked.value ? color : '#DFDFDF', backgroundColor: switchChecked.value ? color : '#DFDFDF',
......
//#region Functions //#region Functions
import { reactive, nextTick, watch } from 'vue' import { reactive, nextTick, watch, watchEffect } from 'vue'
import { extend } from '@vue/shared' import { extend } from '@vue/shared'
import { import {
defineAsyncApi, defineAsyncApi,
...@@ -27,7 +27,7 @@ import type { ...@@ -27,7 +27,7 @@ import type {
import { once } from '@dcloudio/uni-shared' import { once } from '@dcloudio/uni-shared'
//#endregion //#endregion
let showToastState: ToastProps export let showToastState: ToastProps
let showType: 'onShowToast' | 'onShowLoading' | '' = '' let showType: 'onShowToast' | 'onShowLoading' | '' = ''
let timeoutId: number let timeoutId: number
const onHidePopupOnce = /*#__PURE__*/ once(() => { const onHidePopupOnce = /*#__PURE__*/ once(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册