From 953d3d44267d2c1f9f85bc4e51fbddcc72ae7476 Mon Sep 17 00:00:00 2001 From: oasis Date: Thu, 14 Nov 2024 18:37:13 +0800 Subject: [PATCH] docs: components can be searched --- packages/nutui-taro-demo/src/pages/index/index.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/nutui-taro-demo/src/pages/index/index.tsx b/packages/nutui-taro-demo/src/pages/index/index.tsx index 54de2dd9b..2bd2fecd6 100644 --- a/packages/nutui-taro-demo/src/pages/index/index.tsx +++ b/packages/nutui-taro-demo/src/pages/index/index.tsx @@ -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({ @@ -55,6 +51,9 @@ const Index = () => { + { + setSearch(e.detail.value) + }} /> {navs.map((nav) => ( @@ -63,7 +62,7 @@ const Index = () => { )} {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()) ? (