Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 解决skeleton引入switch按钮尺寸过大 #2886

Merged
merged 9 commits into from
Dec 25, 2024
2 changes: 1 addition & 1 deletion src/packages/skeleton/demos/h5/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Demo5 = () => {
<div style={{ width: '100%' }}>
<Switch
onChange={(value, event) => changeStatus(value, event)}
style={{ display: 'flex', marginBottom: '8px' }}
style={{ marginBottom: '8px' }}
/>
<Skeleton title animated avatar rows={3} visible={checked}>
<div className="nut-skeleton-content">
Expand Down
16 changes: 11 additions & 5 deletions src/packages/skeleton/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Avatar, Skeleton, Switch } from '@nutui/nutui-react-taro'
import React, { useState } from 'react'
import { View, Text } from '@tarojs/components'
import pxTransform from '@/utils/px-transform'

const Demo5 = () => {
const [checked, setChecked] = useState(false)
Expand All @@ -14,10 +13,17 @@ const Demo5 = () => {
}
return (
<View style={{ width: '100%' }}>
<Switch
onChange={(value, event: any) => changeStatus(value, event)}
style={{ display: 'flex', marginBottom: pxTransform(8) }}
/>
<View
style={{
display: 'flex',
justifyContent: 'flex-start',
}}
>
<Switch
onChange={(value, event: any) => changeStatus(value, event)}
style={{ marginBottom: 8 }}
/>
</View>
<Skeleton title animated avatar rows={3} visible={checked}>
<View
className="nut-skeleton-content"
Expand Down
2 changes: 1 addition & 1 deletion src/packages/switch/switch.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.nut-switch {
cursor: pointer;
position: relative;
display: flex;
display: inline-flex;
flex-direction: row;
align-items: center;
min-width: $switch-width;
Expand Down
Loading