Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
12c7ed6f
N
nutui-react
项目概览
京东前端
/
nutui-react
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui-react
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
12c7ed6f
编写于
3月 13, 2023
作者:
E
eiinu
提交者:
GitHub
3月 13, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(backtop): icon 组件替换 (#774)
上级
88f7bd06
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
37 addition
and
47 deletion
+37
-47
src/packages/backtop/backtop.taro.tsx
src/packages/backtop/backtop.taro.tsx
+4
-13
src/packages/backtop/backtop.tsx
src/packages/backtop/backtop.tsx
+10
-15
src/packages/backtop/demo.taro.tsx
src/packages/backtop/demo.taro.tsx
+4
-3
src/packages/backtop/demo.tsx
src/packages/backtop/demo.tsx
+3
-3
src/packages/backtop/doc.en-US.md
src/packages/backtop/doc.en-US.md
+3
-2
src/packages/backtop/doc.md
src/packages/backtop/doc.md
+3
-2
src/packages/backtop/doc.taro.md
src/packages/backtop/doc.taro.md
+7
-6
src/packages/backtop/doc.zh-TW.md
src/packages/backtop/doc.zh-TW.md
+3
-3
未找到文件。
src/packages/backtop/backtop.taro.tsx
浏览文件 @
12c7ed6f
import
React
,
{
FunctionComponent
,
useState
}
from
'
react
'
import
React
,
{
FunctionComponent
,
ReactNode
,
useState
}
from
'
react
'
import
{
usePageScroll
,
pageScrollTo
}
from
'
@tarojs/taro
'
import
Icon
from
'
@/packages/icon/index.
taro
'
import
{
Top
}
from
'
@nutui/icons-react-
taro
'
import
{
BasicComponent
,
ComponentDefaults
}
from
'
@/utils/typings
'
declare
const
window
:
any
...
...
@@ -15,7 +14,7 @@ export interface BackTopProps extends BasicComponent {
zIndex
:
number
isAnimation
:
boolean
duration
:
number
children
?:
HTMLElement
|
any
children
?:
ReactNode
style
?:
React
.
CSSProperties
onClick
?:
(
event
:
MouseEvent
)
=>
void
}
...
...
@@ -46,8 +45,6 @@ export const BackTop: FunctionComponent<
duration
,
style
,
onClick
,
iconClassPrefix
,
iconFontClassName
,
}
=
{
...
defaultProps
,
...
props
,
...
...
@@ -85,13 +82,7 @@ export const BackTop: FunctionComponent<
}
}
>
{
children
||
(
<
Icon
classPrefix
=
{
iconClassPrefix
}
fontClassName
=
{
iconFontClassName
}
size
=
"19px"
className
=
"nut-backtop-main"
name
=
"top"
/>
<
Top
width
=
{
19
}
height
=
{
19
}
className
=
"nut-backtop-main"
/>
)
}
</
div
>
</>
...
...
src/packages/backtop/backtop.tsx
浏览文件 @
12c7ed6f
import
React
,
{
FunctionComponent
,
useEffect
,
useState
,
useRef
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
React
,
{
FunctionComponent
,
useEffect
,
useState
,
useRef
,
ReactNode
,
}
from
'
react
'
import
{
Top
}
from
'
@nutui/icons-react
'
import
{
BasicComponent
,
ComponentDefaults
}
from
'
@/utils/typings
'
declare
const
window
:
any
...
...
@@ -14,7 +19,7 @@ export interface BackTopProps extends BasicComponent {
zIndex
:
number
isAnimation
:
boolean
duration
:
number
children
?:
HTMLElement
|
any
children
?:
ReactNode
style
?:
React
.
CSSProperties
onClick
?:
(
event
:
MouseEvent
)
=>
void
}
...
...
@@ -45,8 +50,6 @@ export const BackTop: FunctionComponent<
duration
,
style
,
onClick
,
iconClassPrefix
,
iconFontClassName
,
}
=
{
...
defaultProps
,
...
props
,
...
...
@@ -152,15 +155,7 @@ export const BackTop: FunctionComponent<
goTop
(
e
)
}
}
>
{
children
||
(
<
Icon
classPrefix
=
{
iconClassPrefix
}
fontClassName
=
{
iconFontClassName
}
size
=
"19px"
className
=
"nut-backtop-main"
name
=
"top"
/>
)
}
{
children
||
<
Top
width
=
{
19
}
height
=
{
19
}
className
=
"nut-backtop-main"
/>
}
</
div
>
)
}
...
...
src/packages/backtop/demo.taro.tsx
浏览文件 @
12c7ed6f
import
React
from
'
react
'
import
{
BackTop
,
Icon
}
from
'
@/packages/nutui.react.taro
'
import
Taro
from
'
@tarojs/taro
'
import
{
Top
}
from
'
@nutui/icons-react-taro
'
import
{
BackTop
}
from
'
@/packages/nutui.react.taro
'
import
{
useTranslate
}
from
'
@/sites/assets/locale/taro
'
import
Header
from
'
@/sites/components/header
'
import
Taro
from
'
@tarojs/taro
'
interface
T
{
title
:
string
...
...
@@ -141,7 +142,7 @@ const BackTopDemo = () => {
alignItems
:
'
center
'
,
}
}
>
<
Icon
size
=
"12px"
className
=
"nut-backtop-main"
name
=
"top
"
/>
<
Top
width
=
{
12
}
height
=
{
12
}
className
=
"nut-backtop-main
"
/>
<
div
style
=
{
{
fontSize
:
'
12px
'
}
}
>
{
translated
.
backText
}
</
div
>
</
div
>
</
BackTop
>
...
...
src/packages/backtop/demo.tsx
浏览文件 @
12c7ed6f
import
React
from
'
react
'
import
{
Top
}
from
'
@nutui/icons-react
'
import
{
BackTop
}
from
'
./backtop
'
import
{
useTranslate
}
from
'
../../sites/assets/locale
'
import
Icon
from
'
@/packages/icon
'
interface
T
{
title
:
string
...
...
@@ -136,11 +136,11 @@ const BackTopDemo = () => {
alignItems
:
'
center
'
,
}
}
>
<
Icon
size
=
"12px"
className
=
"nut-backtop-main"
name
=
"top"
/>
<
Top
width
=
{
12
}
height
=
{
12
}
/>
<
div
style
=
{
{
fontSize
:
'
12px
'
}
}
>
{
translated
.
backText
}
</
div
>
</
div
>
</
BackTop
>
<
BackTop
elId
=
"elId"
distance
=
{
200
}
bottom
=
{
50
}
onClick
=
{
handleClick
}
/>
{
/* <BackTop elId="elId" distance={200} bottom={50} onClick={handleClick} /> */
}
</
div
>
</>
)
...
...
src/packages/backtop/doc.en-US.md
浏览文件 @
12c7ed6f
...
...
@@ -129,7 +129,8 @@ export default App;
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
,
Icon
}
from
'
@nutui/nutui-react
'
;
import
{
BackTop
}
from
'
@nutui/nutui-react
'
;
import
{
Top
}
from
'
@nutui/icons-react
'
;
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
@@ -183,7 +184,7 @@ const App = () => {
alignItems
:
'
center
'
,
}
}
>
<
Icon
size
=
"12px"
className
=
"nut-backtop-main"
name
=
"top
"
/>
<
Top
width
=
{
12
}
height
=
{
12
}
className
=
"nut-backtop-main
"
/>
<
div
style
=
{
{
fontSize
:
'
12px
'
}
}
>
TOP
</
div
>
</
div
>
</
BackTop
>
...
...
src/packages/backtop/doc.md
浏览文件 @
12c7ed6f
...
...
@@ -132,7 +132,8 @@ export default App;
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
,
Icon
}
from
'
@nutui/nutui-react
'
;
import
{
BackTop
}
from
'
@nutui/nutui-react
'
;
import
{
Top
}
from
'
@nutui/icons-react
'
;
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
@@ -186,7 +187,7 @@ const App = () => {
alignItems
:
'
center
'
,
}
}
>
<
Icon
size
=
"12px"
className
=
"nut-backtop-main"
name
=
"top
"
/>
<
Top
width
=
{
12
}
height
=
{
12
}
className
=
"nut-backtop-main
"
/>
<
div
style
=
{
{
fontSize
:
'
12px
'
}
}
>
顶部
</
div
>
</
div
>
</
BackTop
>
...
...
src/packages/backtop/doc.taro.md
浏览文件 @
12c7ed6f
...
...
@@ -7,7 +7,7 @@
### 安装
```
javascript
import
{
BackTop
}
from
'
@
/packages/nutui.react.
taro
'
import
{
BackTop
}
from
'
@
nutui/nutui-react-
taro
'
```
## 代码演示
...
...
@@ -18,7 +18,7 @@ import { BackTop } from '@/packages/nutui.react.taro'
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
}
from
'
@
/packages/nutui.react.
taro
'
import
{
BackTop
}
from
'
@
nutui/nutui-react-
taro
'
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
@@ -74,7 +74,7 @@ export default App;
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
}
from
'
@
/packages/nutui.react.taro
'
import
{
BackTop
}
from
'
@
nutui/nutui-react-taro
'
;
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
@@ -129,7 +129,8 @@ export default App;
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
,
Icon
}
from
'
@/packages/nutui.react.taro
'
import
{
BackTop
}
from
'
@nutui/nutui-react-taro
'
;
import
{
Top
}
from
'
@nutui/icons-react-taro
'
;
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
@@ -179,7 +180,7 @@ const App = () => {
alignItems
:
'
center
'
,
}
}
>
<
Icon
size
=
"12px"
className
=
"nut-backtop-main"
name
=
"top
"
/>
<
Top
width
=
{
12
}
height
=
{
12
}
className
=
"nut-backtop-main
"
/>
<
div
style
=
{
{
fontSize
:
'
12px
'
}
}
>
顶部
</
div
>
</
div
>
</
BackTop
>
...
...
@@ -197,7 +198,7 @@ export default App;
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
}
from
'
@
/packages/nutui.react.
taro
'
import
{
BackTop
}
from
'
@
nutui/nutui-react-
taro
'
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
src/packages/backtop/doc.zh-TW.md
浏览文件 @
12c7ed6f
...
...
@@ -131,8 +131,8 @@ export default App;
```
tsx
import
React
from
"
react
"
;
import
{
BackTop
,
Icon
}
from
'
@nutui/nutui-react
'
;
import
{
BackTop
}
from
'
@nutui/nutui-react
'
;
import
{
Top
}
from
'
@nutui/icons-react
'
;
const
App
=
()
=>
{
const
cellStyle
=
{
...
...
@@ -186,7 +186,7 @@ const App = () => {
alignItems
:
'
center
'
,
}
}
>
<
Icon
size
=
"12px"
className
=
"nut-backtop-main"
name
=
"top
"
/>
<
Top
width
=
{
12
}
height
=
{
12
}
className
=
"nut-backtop-main
"
/>
<
div
style
=
{
{
fontSize
:
'
12px
'
}
}
>
顶部
</
div
>
</
div
>
</
BackTop
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录