Skip to content

Commit 0ade40f

Browse files
committed
fix: 修复打包时候的类型错误
1 parent f00da38 commit 0ade40f

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

src/packages/address/existRender.taro.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { FunctionComponent, MouseEventHandler, ReactNode } from 'react'
1+
import React, { FunctionComponent, ReactNode } from 'react'
22
import { Check, Location } from '@nutui/icons-react-taro'
3-
import { ScrollView, View } from '@tarojs/components'
3+
import { ScrollView, View, ITouchEvent } from '@tarojs/components'
44
import { useConfig } from '@/packages/configprovider/configprovider.taro'
55
import { AddressList } from './types'
66

@@ -51,7 +51,7 @@ export const ExistRender: FunctionComponent<
5151
onSelect && onSelect(item)
5252
}
5353

54-
const onClick: MouseEventHandler = (e) => {
54+
const onClick = (e: ITouchEvent) => {
5555
e.stopPropagation()
5656
onSwitch && onSwitch({ type: type === 'exist' ? 'custom' : 'exist' })
5757
}

src/packages/button/button.taro.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface ButtonProps
3939
disabled: boolean
4040
icon: React.ReactNode
4141
rightIcon: React.ReactNode
42-
nativeType: 'submit' | 'reset' | 'button'
42+
nativeType: 'submit' | 'reset'
4343
onClick: (e: MouseEvent<HTMLButtonElement>) => void
4444
}
4545

@@ -114,7 +114,7 @@ export const Button = React.forwardRef<HTMLButtonElement, Partial<ButtonProps>>(
114114
<TaroButton
115115
{...rest}
116116
ref={ref}
117-
type={nativeType}
117+
formType={nativeType}
118118
className={classNames(
119119
prefixCls,
120120
`${prefixCls}-${type}`,

src/packages/configprovider/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export type NutCSSVariables =
282282
| 'nutuiSwitchBorderRadius'
283283
| 'nutuiSwitchInsideWidth'
284284
| 'nutuiSwitchInsideHeight'
285+
| 'nutuiSwitchInsideBorderRadius'
285286
| 'nutuiSwitchInsideOpenTransform'
286287
| 'nutuiSwitchInsideCloseTransform'
287288
| 'nutuiSwitchBoxShadow'

src/packages/uploader/uploader.taro.tsx

+3-11
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,12 @@ const InternalUploader: ForwardRefRenderFunction<
486486
<View className="nut-uploader-slot">
487487
<>
488488
{children || (
489-
<Button nativeType="button" size="small" type="primary">
489+
<Button size="small" type="primary">
490490
上传文件
491491
</Button>
492492
)}
493493
{Number(maxCount) > fileList.length && (
494-
<Button
495-
nativeType="button"
496-
className="nut-uploader-input"
497-
onClick={_chooseImage}
498-
/>
494+
<Button className="nut-uploader-input" onClick={_chooseImage} />
499495
)}
500496
</>
501497
</View>
@@ -525,11 +521,7 @@ const InternalUploader: ForwardRefRenderFunction<
525521
{uploadIcon}
526522
<span className="nut-uploader-icon-tip">{uploadLabel}</span>
527523
</View>
528-
<Button
529-
nativeType="button"
530-
className="nut-uploader-input"
531-
onClick={_chooseImage}
532-
/>
524+
<Button className="nut-uploader-input" onClick={_chooseImage} />
533525
</View>
534526
)}
535527
</View>

0 commit comments

Comments
 (0)