From ebcf943593d45b153cc740c13b946e9a89bee53e Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Sat, 25 Apr 2020 22:42:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(accordion):=20=E4=BF=AE=E5=A4=8D=20Accordio?= =?UTF-8?q?n=20=E7=A4=BA=E4=BE=8B=E7=9A=84=20Bug,=20close=20#995?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/layout/accordion/index.tsx | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/pages/layout/accordion/index.tsx b/src/pages/layout/accordion/index.tsx index 472c43cbf..cf9aef3ca 100644 --- a/src/pages/layout/accordion/index.tsx +++ b/src/pages/layout/accordion/index.tsx @@ -13,23 +13,23 @@ export default class CardPage extends Taro.Component<{}, CardPageState> { navigationBarTitleText: 'Taro UI' } - public constructor () { + public constructor() { super(...arguments) this.state = { value1: false, value2: true, value3: false, - value4: false, + value4: false } } - private onClick (stateName: string, value: boolean): void { + private onClick(stateName: string, value: boolean): void { this.setState({ [stateName]: value }) } - public render (): JSX.Element { + public render(): JSX.Element { const { value1, value2, value3, value4 } = this.state return ( @@ -41,9 +41,9 @@ export default class CardPage extends Taro.Component<{}, CardPageState> { { /> + + + + + {/* 默认开启 */} + + 默认开启 + + @@ -89,8 +98,8 @@ export default class CardPage extends Taro.Component<{}, CardPageState> { @@ -116,11 +125,11 @@ export default class CardPage extends Taro.Component<{}, CardPageState> {