refactor(miniprogram): 消灭全部 any 类型 — 32处 → 0 (E3-1)
- catch (err: any) → catch (err: unknown) + instanceof Error 类型缩窄(6 文件 13 处) - BLE 回调类型提取 BLEScanResult/BLEConnectionChangeResult/BLECharacteristicChangeResult/BLEServiceItem - BLEManager 7 处 any 注解替换为具体接口类型 - request.ts method as any → method as ValidMethod 字面量联合类型 - appointment ScheduleItem 接口定义替代 any[] - Taro.requestSubscribeMessage 使用类型断言替代 as any - globalThis.__hms 使用 Record<string, unknown> - TrendChart Canvas/useRef 保留 eslint-disable(微信 API 限制) - 0 TS 错误,119 测试通过
This commit is contained in:
@@ -21,7 +21,7 @@ function InputField({ label, value, placeholder, type = 'digit', onChange }: {
|
||||
<Text className='form-label'>{label}</Text>
|
||||
<Input
|
||||
className='form-input'
|
||||
type={type as any}
|
||||
type={type as 'digit' | 'number' | 'text'}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onInput={(e) => onChange(e.detail.value)}
|
||||
|
||||
@@ -111,7 +111,7 @@ export default function PrescriptionCreate() {
|
||||
<Text className='form-label'>{label}</Text>
|
||||
<Input
|
||||
className='form-input'
|
||||
type={type as any}
|
||||
type={type as 'digit' | 'number' | 'text'}
|
||||
placeholder={placeholder}
|
||||
value={form[field]}
|
||||
onInput={(e) => updateField(field, e.detail.value)}
|
||||
|
||||
Reference in New Issue
Block a user