🌈 style(eslint): add eslint rules

This commit is contained in:
xuan
2022-11-26 14:35:05 +08:00
parent f3aa20f049
commit 99a920975f
245 changed files with 14909 additions and 14349 deletions
+7 -6
View File
@@ -1,10 +1,11 @@
import { View } from '@tarojs/components'
import { memo, ReactNode, useMemo } from 'react'
import type { ReactNode } from 'react'
import { memo, useMemo } from 'react'
import IconFont from '../iconfont/iconfont'
import InputX from '../InputX'
import styles from './index.module.scss'
type Params = {
interface Params {
showIcon?: boolean
disabled?: boolean
placeholder?: string
@@ -20,7 +21,7 @@ type Params = {
}
export default memo((props: Params) => {
let {
const {
showTitle = true,
title = '标题',
showIcon = false,
@@ -33,14 +34,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}
@@ -51,7 +52,7 @@ export default memo((props: Params) => {
<InputX disabled={disabled} placeholder={placeholder} onClick={() => clickOnInput?.()} onInput={e => changeOnInput?.(e.detail.value)} />
)) || <>{props.children}</>}
</View>
{showIcon && <IconFont customClassName={styles.icon_more_self} name='icon-chakanquanbukehu' size={36} color='#333'></IconFont>}
{showIcon && <IconFont customClassName={styles.icon_more_self} name="icon-chakanquanbukehu" size={36} color="#333"></IconFont>}
</View>
)
})