-
Notifications
You must be signed in to change notification settings - Fork 286
docs: components can be searched #2757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
953d3d4
153e2a7
c7521c3
e65a8f8
83cc24c
8061c80
6e00250
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||||||||||
| import Taro from '@tarojs/taro' | ||||||||||||||||||||||
| import { useState } from 'react' | ||||||||||||||||||||||
| import { | ||||||||||||||||||||||
| View, | ||||||||||||||||||||||
| Image, | ||||||||||||||||||||||
|
|
@@ -11,21 +12,19 @@ import { | |||||||||||||||||||||
| Video, | ||||||||||||||||||||||
| Textarea, | ||||||||||||||||||||||
| } from '@tarojs/components' | ||||||||||||||||||||||
| import { SearchBar } from '@/packages/searchbar/searchbar.taro' | ||||||||||||||||||||||
| import pkg from '@/packages/../config.json' | ||||||||||||||||||||||
| import packageJson from '@/packages/../../package.json' | ||||||||||||||||||||||
| import './index.scss' | ||||||||||||||||||||||
| // import Schema from 'async-validator' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const navs = pkg.nav | ||||||||||||||||||||||
| // console.log(navs) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // hack taro load button xml | ||||||||||||||||||||||
| console.log(Button, Input, Video, Image, Swiper, SwiperItem, Textarea) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // try { | ||||||||||||||||||||||
| // console.log('xxx', Schema) | ||||||||||||||||||||||
| // } catch (e) {} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const Index = () => { | ||||||||||||||||||||||
| const [search, setSearch] = useState() | ||||||||||||||||||||||
| const gotoNext = (name: string, enName: string) => { | ||||||||||||||||||||||
| // 跳转到目的页面,打开新页面 | ||||||||||||||||||||||
| Taro.navigateTo({ | ||||||||||||||||||||||
|
|
@@ -67,15 +66,22 @@ const Index = () => { | |||||||||||||||||||||
| </View> | ||||||||||||||||||||||
| </View> | ||||||||||||||||||||||
| </View> | ||||||||||||||||||||||
| <View className="index-components"> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <View className='index-components'> | ||||||||||||||||||||||
| {process.env.NODE_ENV === 'development' ? <> | ||||||||||||||||||||||
| <SearchBar style={{ background: '#fff' }} placeholder='' value={search} onChange={(e) => { | ||||||||||||||||||||||
|
Comment on lines
+71
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修复 JSX 语法错误 代码中存在以下语法错误:
- {process.env.NODE_ENV === 'development' ? <>
- <SearchBar style={{ background: '#fff' }} placeholder='' value={search} onChange={(e) => {
- setSearch(e)
- }} />
- <View style={{ height: 25 }}></View>
+ {process.env.NODE_ENV === 'development' ? (
+ <>
+ <SearchBar style={{ background: '#fff' }} placeholder='' value={search} onChange={(e) => {
+ setSearch(e)
+ }} />
+ <View style={{ height: 25 }}></View>
+ </>
+ ) : null}📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 72-72: JSX fragment has no corresponding closing tag. Opening fragment Closing tag (parse) [error] 71-72: Expected corresponding JSX closing tag for 'View'. Opening tag closing tag (parse) |
||||||||||||||||||||||
| setSearch(e) | ||||||||||||||||||||||
| }} /> | ||||||||||||||||||||||
| <View style={{ height: 25 }}></View> | ||||||||||||||||||||||
| </> : null} | ||||||||||||||||||||||
| {navs.map((nav) => ( | ||||||||||||||||||||||
| <View key={nav.enName} className="index-components-item"> | ||||||||||||||||||||||
| {nav.enName === 'dataentry' ? null : ( | ||||||||||||||||||||||
| <View className="index-components-item-title">{nav.name}</View> | ||||||||||||||||||||||
| )} | ||||||||||||||||||||||
| <View className="index-components-sublist"> | ||||||||||||||||||||||
| {nav.packages.map((com) => | ||||||||||||||||||||||
| com.show && com.taro && com.version === '3.0.0' ? ( | ||||||||||||||||||||||
| com.show && com.taro && com.version === '3.0.0' && (!search || new RegExp(search, 'ig').test(com.name.toLowerCase())) ? ( | ||||||||||||||||||||||
| <View | ||||||||||||||||||||||
| key={com.name} | ||||||||||||||||||||||
| className="index-components-sublist-item" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.