Skip to content

Commit

Permalink
refactor: 移除一些无厘头的功能, 兼容 nutui2.x 版本的 Button API
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmin0412 committed Apr 12, 2024
1 parent 9a1e11a commit 2fd96cd
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/demo/router/router.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.demo-router-page {
width: 100%;
padding: 0 20px;
box-sizing: border-box;

.nut-button {
margin-top: 10px;
}
}
38 changes: 32 additions & 6 deletions src/demo/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,38 @@ const RouterDemo = (): JSX.Element => {
return (
<View className="demo-router-page">
<CustomNavigationHeader title="路由演示" />
<Button size='large' type='primary' onClick={() => handleRouterTest('navigateTo')}>navigateTo</Button>
<Button size='large' type='primary' onClick={() => handleRouterTest('redirectTo')}>redirectTo</Button>
<Button size='large' type='primary' onClick={() => handleRouterTest('relaunch')}>relanuch</Button>
<Button size='large' type='primary' onClick={() => handleRouterTest('navigateBack')}>navigateBack</Button>
<Button size='large' type='primary' onClick={() => handleRouterTest('relaunch', 'noUrl')}>url校验</Button>
<Button size='large' type='primary' onClick={() => handleRouterTest('relaunch', 'invalidUrl')}>relaunch</Button>
<Button
block
size="large"
type="primary"
onClick={() => handleRouterTest('navigateTo')}
>
navigateTo
</Button>
<Button
block
size="large"
type="primary"
onClick={() => handleRouterTest('redirectTo')}
>
redirectTo
</Button>
<Button
block
size="large"
type="primary"
onClick={() => handleRouterTest('relaunch')}
>
relanuch
</Button>
<Button
block
size="large"
type="primary"
onClick={() => handleRouterTest('navigateBack')}
>
navigateBack
</Button>
</View>
)
}
Expand Down
8 changes: 8 additions & 0 deletions src/index/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
font-size: $baseFontColor;
box-sizing: border-box;
}

.index {
padding: 0 20px;

.nut-button {
margin-top: 10px;
}
}
2 changes: 2 additions & 0 deletions src/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ const Index = (): JSX.Element => {
containerClass="index"
>
<Button
block
size="large"
type="primary"
onClick={() => jumpToDemo('router')}
>
路由跳转
</Button>
<Button
block
size="large"
type="primary"
onClick={() => jumpToDemo('form')}
Expand Down

0 comments on commit 2fd96cd

Please sign in to comment.