🌈 style(eslint): 新增eslint规则

This commit is contained in:
xuan
2022-12-02 18:59:29 +08:00
parent c3cb46a5a7
commit d49314aa5b
217 changed files with 19491 additions and 19187 deletions
+8 -7
View File
@@ -1,8 +1,9 @@
import { Input, View } from '@tarojs/components'
import { memo, ReactHTMLElement, ReactNode, useDebugValue, useMemo } from 'react'
import type { ReactNode } from 'react'
import { ReactHTMLElement, memo, useDebugValue, useMemo } from 'react'
import styles from './index.module.scss'
type Params = {
interface Params {
showIcon?: false | true
disabled?: false | true
placeholder?: string
@@ -18,7 +19,7 @@ type Params = {
}
export default memo((props: Params) => {
let {
const {
showTitle = true,
title = '标题',
showIcon = false,
@@ -31,14 +32,14 @@ export default memo((props: Params) => {
titleStyle = {},
} = props
let stylen = useMemo(() => {
const stylen = useMemo(() => {
if (!showBorder) {
return { borderBottom: 0 }
}
return {}
}, [showBorder])
return (
<View className={styles.searchInput_main} style={{ height: height, ...stylen }}>
<View className={styles.searchInput_main} style={{ height, ...stylen }}>
{showTitle && (
<View className={styles.searchInput_title} style={titleStyle}>
{title}
@@ -47,12 +48,12 @@ export default memo((props: Params) => {
<View className={styles.searchInput_con}>
{(!props.children && (
<Input
alwaysEmbed={true}
alwaysEmbed
cursorSpacing={150}
disabled={disabled}
placeholder={placeholder}
onClick={() => clickOnInput?.()}
onInput={(e) => changeOnInput?.(e.detail.value)}
onInput={e => changeOnInput?.(e.detail.value)}
/>
)) || <>{props.children}</>}
</View>