Skip to content

Commit

Permalink
docs: components can be searched
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Nov 14, 2024
1 parent 4b427a1 commit 953d3d4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/nutui-taro-demo/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import Taro from '@tarojs/taro'
import { useState } from 'react'
import { View, Image, Text, ScrollView, Button, Input, Video } from '@tarojs/components'
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 )

// try {
// console.log('xxx', Schema)
// } catch (e) {}
const Index = () => {
const [search, setSearch] = useState()
const gotoNext = (name: string, enName: string) => {
// 跳转到目的页面,打开新页面
Taro.navigateTo({
Expand Down Expand Up @@ -55,6 +51,9 @@ const Index = () => {
</View>
</View>
</View>
<Input value={search} onInput={(e) => {
setSearch(e.detail.value)
}} />
<View className='index-components'>
{navs.map((nav) => (
<View key={nav.enName} className='index-components-item'>
Expand All @@ -63,7 +62,7 @@ const Index = () => {
)}
<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 || search == com.name.toLowerCase()) ? (
<View
key={com.name}
className='index-components-sublist-item'
Expand Down

0 comments on commit 953d3d4

Please sign in to comment.