File tree Expand file tree Collapse file tree 4 files changed +63
-5
lines changed
Expand file tree Collapse file tree 4 files changed +63
-5
lines changed Original file line number Diff line number Diff line change 5151 right : 5px ;
5252 top : 53% ;
5353 }
54- & __input {
55- box-sizing : border-box ;
54+ .nut-searchbar__input-box {
5655 display : flex ;
5756 align-items : center ;
57+ flex : 1 ;
58+ }
59+ & __input {
60+ border : 0 ;
61+ outline : 0 ;
62+ box-sizing : border-box ;
63+
5864 width : $searchbar-input-width ;
5965 height : $searchbar-input-height ;
60- flex : 1 ;
66+ width : 100 % ;
6167 padding : $searchbar-input-padding ;
6268 border-radius : 0 ;
6369 font-size : $font-size-small ;
105111 margin-left : 10px ;
106112 }
107113}
114+ .nut-searchbar-taro {
115+ .nut-searchbar__leftin-icon {
116+ top : 41% ;
117+ }
118+ .nut-searchbar__rightin-icon {
119+ top : 41% ;
120+ }
121+ .nut-searchbar__clear {
122+ top : 33% ;
123+ }
124+ }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import bem from '@/utils/bem'
33import { useConfig } from '@/packages/configprovider/configprovider.taro'
44import Icon from '@/packages/icon/index.taro'
55import { IComponent , ComponentDefaults } from '@/utils/typings'
6+ import Taro from '@tarojs/taro'
67
78type TIconDirection = 'in-left' | 'out-left' | 'in-right' | 'out-right'
89
@@ -297,9 +298,14 @@ export const SearchBar: FunctionComponent<
297298 }
298299 return null
299300 }
301+
302+ const envClass = ( ) => {
303+ return Taro . getEnv ( ) === 'WEB' ? 'nut-searchbar-taro' : ''
304+ }
305+
300306 return (
301307 < div
302- className = { `${ searchbarBem ( ) } ${
308+ className = { `${ searchbarBem ( ) } ${ envClass ( ) } ${
303309 disabled ? searchbarBem ( 'disabled' ) : ''
304310 } ${ className || '' } `}
305311 style = { { ...props . style , background : props . background } }
@@ -308,7 +314,7 @@ export const SearchBar: FunctionComponent<
308314 { renderLabel ( ) }
309315 < div className = { `${ searchbarBem ( 'content' ) } ` } >
310316 { renderLeftinIcon ( ) }
311- { renderField ( ) }
317+ < div className = "nut-searchbar__input-box" > { renderField ( ) } </ div >
312318 { renderRightinIcon ( ) }
313319 { clearable && value && handleClear ( ) }
314320 </ div >
Original file line number Diff line number Diff line change 1+ {
2+ "appid" : " wx6b455a756cd0a489" ,
3+ "compileType" : " miniprogram" ,
4+ "libVersion" : " 2.27.0" ,
5+ "packOptions" : {
6+ "ignore" : [],
7+ "include" : []
8+ },
9+ "setting" : {
10+ "coverView" : true ,
11+ "es6" : true ,
12+ "postcss" : true ,
13+ "minified" : true ,
14+ "enhance" : true ,
15+ "showShadowRootInWxmlPanel" : true ,
16+ "packNpmRelationList" : [],
17+ "babelSetting" : {
18+ "ignore" : [],
19+ "disablePlugins" : [],
20+ "outputPath" : " "
21+ }
22+ },
23+ "condition" : {},
24+ "editorSetting" : {
25+ "tabIndent" : " insertSpaces" ,
26+ "tabSize" : 2
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ {
2+ "description" : " 项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html" ,
3+ "projectname" : " mobile" ,
4+ "setting" : {
5+ "compileHotReLoad" : true
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments