Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
24ccf123
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,发现更多精彩内容 >>
未验证
提交
24ccf123
编写于
11月 07, 2022
作者:
V
vickyYe
提交者:
GitHub
11月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: noticebar 关闭事件优化,小程序样式优化 (#424)
上级
43045930
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
69 addition
and
47 deletion
+69
-47
src/packages/noticebar/demo.taro.tsx
src/packages/noticebar/demo.taro.tsx
+8
-4
src/packages/noticebar/demo.tsx
src/packages/noticebar/demo.tsx
+8
-4
src/packages/noticebar/doc.en-US.md
src/packages/noticebar/doc.en-US.md
+6
-3
src/packages/noticebar/doc.md
src/packages/noticebar/doc.md
+6
-3
src/packages/noticebar/doc.zh-TW.md
src/packages/noticebar/doc.zh-TW.md
+6
-3
src/packages/noticebar/noticebar.scss
src/packages/noticebar/noticebar.scss
+3
-0
src/packages/noticebar/noticebar.taro.tsx
src/packages/noticebar/noticebar.taro.tsx
+16
-15
src/packages/noticebar/noticebar.tsx
src/packages/noticebar/noticebar.tsx
+16
-15
未找到文件。
src/packages/noticebar/demo.taro.tsx
浏览文件 @
24ccf123
...
...
@@ -84,8 +84,8 @@ const NoticeBarDemo = () => {
list
=
{
horseLamp1
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
onClick
=
{
(
e
)
=>
{
go
(
e
.
target
.
innerHTML
)
}
}
closeMode
/>
...
...
@@ -109,8 +109,12 @@ const NoticeBarDemo = () => {
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
closeMode
onClose
=
{
()
=>
{
console
.
log
(
'
close
'
)
}
}
onClick
=
{
(
e
)
=>
{
console
.
log
(
e
)
}
}
>
{
horseLamp3
.
map
((
item
,
index
)
=>
{
...
...
src/packages/noticebar/demo.tsx
浏览文件 @
24ccf123
...
...
@@ -85,8 +85,8 @@ const NoticeBarDemo = () => {
list
=
{
horseLamp1
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
onClick
=
{
(
e
)
=>
{
go
(
e
.
target
.
innerHTML
)
}
}
closeMode
/>
...
...
@@ -110,8 +110,12 @@ const NoticeBarDemo = () => {
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
closeMode
onClose
=
{
()
=>
{
console
.
log
(
'
close
'
)
}
}
onClick
=
{
(
e
)
=>
{
console
.
log
(
e
)
}
}
>
{
horseLamp3
.
map
((
item
,
index
)
=>
{
...
...
src/packages/noticebar/doc.en-US.md
浏览文件 @
24ccf123
...
...
@@ -134,8 +134,8 @@ const App = () => {
list
=
{
horseLamp1
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
onClick
=
{
(
e
)
=>
{
go
(
e
.
target
.
innerHtml
)
}
}
closeMode
/>
...
...
@@ -188,7 +188,10 @@ const App = () => {
return
(
<>
<
NoticeBar
direction
=
"vertical"
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
>
<
NoticeBar
direction
=
"vertical"
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
closeMode
onClose
=
{
()
=>
{
console
.
log
(
'
close
'
)}
}
onClick
=
{
(
e
)
=>
{
console
.
log
(
e
)}
}
>
{
horseLamp3
.
map
((
item
,
index
)
=>
{
return
(
<
div
...
...
src/packages/noticebar/doc.md
浏览文件 @
24ccf123
...
...
@@ -140,8 +140,8 @@ const App = () => {
list
=
{
horseLamp1
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
onClick
=
{
(
e
)
=>
{
go
(
e
.
target
.
innerHtml
)
}
}
closeMode
/>
...
...
@@ -194,7 +194,10 @@ const App = () => {
return
(
<>
<
NoticeBar
direction
=
"vertical"
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
>
<
NoticeBar
direction
=
"vertical"
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
closeMode
onClose
=
{
()
=>
{
console
.
log
(
'
close
'
)}
}
onClick
=
{
(
e
)
=>
{
console
.
log
(
e
)}
}
>
{
horseLamp3
.
map
((
item
,
index
)
=>
{
return
(
<
div
...
...
src/packages/noticebar/doc.zh-TW.md
浏览文件 @
24ccf123
...
...
@@ -140,8 +140,8 @@ const App = () => {
list
=
{
horseLamp1
}
speed
=
{
10
}
standTime
=
{
1000
}
onClick
=
{
(
item
:
any
)
=>
{
go
(
item
)
onClick
=
{
(
e
)
=>
{
go
(
e
.
target
.
innerHtml
)
}
}
closeMode
/>
...
...
@@ -194,7 +194,10 @@ const App = () => {
return
(
<>
<
NoticeBar
direction
=
"vertical"
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
>
<
NoticeBar
direction
=
"vertical"
height
=
{
50
}
speed
=
{
10
}
standTime
=
{
1000
}
closeMode
onClose
=
{
()
=>
{
console
.
log
(
'
close
'
)}
}
onClick
=
{
(
e
)
=>
{
console
.
log
(
e
)}
}
>
{
horseLamp3
.
map
((
item
,
index
)
=>
{
return
(
<
div
...
...
src/packages/noticebar/noticebar.scss
浏览文件 @
24ccf123
...
...
@@ -127,6 +127,9 @@
.go
{
align-self
:
center
;
display
:
flex
;
justify-content
:
center
;
width
:
$noticebar-right-icon-width
;
margin
:
$noticebar-righticon-margin
;
}
}
}
src/packages/noticebar/noticebar.taro.tsx
浏览文件 @
24ccf123
...
...
@@ -242,14 +242,12 @@ export const NoticeBar: FunctionComponent<
/**
* 点击滚动单元
*/
const
go
=
(
item
:
any
)
=>
{
click
&&
click
(
item
)
onClick
&&
onClick
(
item
)
}
const
handleClickIcon
=
()
=>
{
close
&&
close
(
scrollList
[
0
])
onClose
&&
onClose
(
scrollList
[
0
])
const
handleClickIcon
=
(
event
:
MouseEvent
)
=>
{
event
.
stopPropagation
()
SetShowNoticeBar
(
!
closeMode
)
close
&&
close
(
event
)
onClose
&&
onClose
(
event
)
}
const
iconShow
=
()
=>
{
...
...
@@ -347,8 +345,14 @@ export const NoticeBar: FunctionComponent<
)
:
null
}
</
div
>
)
:
null
}
{
scrollList
.
current
.
length
>
0
&&
direction
===
'
vertical
'
?
(
<
div
className
=
"nut-noticebar-vertical"
style
=
{
barStyle
}
>
{
showNoticeBar
&&
scrollList
.
current
.
length
>
0
&&
direction
===
'
vertical
'
?
(
<
div
className
=
"nut-noticebar-vertical"
style
=
{
barStyle
}
onClick
=
{
handleClick
}
>
{
children
?
(
<
div
className
=
"horseLamp_list"
style
=
{
horseLampStyle
}
>
{
scrollList
.
current
.
map
((
item
:
string
,
index
:
number
)
=>
{
...
...
@@ -364,9 +368,6 @@ export const NoticeBar: FunctionComponent<
className
=
"horseLamp_list_item"
style
=
{
{
height
}
}
key
=
{
index
}
onClick
=
{
()
=>
{
go
(
item
)
}
}
>
{
item
}
</
li
>
...
...
@@ -376,8 +377,8 @@ export const NoticeBar: FunctionComponent<
)
}
<
div
className
=
"go"
onClick
=
{
()
=>
{
handleClickIcon
()
onClick
=
{
(
e
)
=>
{
handleClickIcon
(
e
)
}
}
>
{
rightIcon
||
...
...
@@ -385,7 +386,7 @@ export const NoticeBar: FunctionComponent<
<
Icon
classPrefix
=
{
iconClassPrefix
}
fontClassName
=
{
iconFontClassName
}
name
=
"cross"
name
=
{
rightIcon
||
'
close
'
}
color
=
{
color
}
size
=
"11px"
/>
...
...
src/packages/noticebar/noticebar.tsx
浏览文件 @
24ccf123
...
...
@@ -240,14 +240,12 @@ export const NoticeBar: FunctionComponent<
/**
* 点击滚动单元
*/
const
go
=
(
item
:
any
)
=>
{
click
&&
click
(
item
)
onClick
&&
onClick
(
item
)
}
const
handleClickIcon
=
()
=>
{
close
&&
close
(
scrollList
[
0
])
onClose
&&
onClose
(
scrollList
[
0
])
const
handleClickIcon
=
(
event
:
MouseEvent
)
=>
{
event
.
stopPropagation
()
SetShowNoticeBar
(
!
closeMode
)
close
&&
close
(
event
)
onClose
&&
onClose
(
event
)
}
const
iconShow
=
()
=>
{
...
...
@@ -345,8 +343,14 @@ export const NoticeBar: FunctionComponent<
)
:
null
}
</
div
>
)
:
null
}
{
scrollList
.
current
.
length
>
0
&&
direction
===
'
vertical
'
?
(
<
div
className
=
"nut-noticebar-vertical"
style
=
{
barStyle
}
>
{
showNoticeBar
&&
scrollList
.
current
.
length
>
0
&&
direction
===
'
vertical
'
?
(
<
div
className
=
"nut-noticebar-vertical"
style
=
{
barStyle
}
onClick
=
{
handleClick
}
>
{
children
?
(
<
div
className
=
"horseLamp_list"
style
=
{
horseLampStyle
}
>
{
scrollList
.
current
.
map
((
item
:
string
,
index
:
number
)
=>
{
...
...
@@ -362,9 +366,6 @@ export const NoticeBar: FunctionComponent<
className
=
"horseLamp_list_item"
style
=
{
{
height
}
}
key
=
{
index
}
onClick
=
{
()
=>
{
go
(
item
)
}
}
>
{
item
}
</
li
>
...
...
@@ -374,8 +375,8 @@ export const NoticeBar: FunctionComponent<
)
}
<
div
className
=
"go"
onClick
=
{
()
=>
{
handleClickIcon
()
onClick
=
{
(
e
)
=>
{
handleClickIcon
(
e
)
}
}
>
{
rightIcon
||
...
...
@@ -383,7 +384,7 @@ export const NoticeBar: FunctionComponent<
<
Icon
classPrefix
=
{
iconClassPrefix
}
fontClassName
=
{
iconFontClassName
}
name
=
"cross"
name
=
{
rightIcon
||
'
close
'
}
color
=
{
color
}
size
=
"11px"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录