Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
84d97c48
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,体验更适合开发者的 AI 搜索 >>
提交
84d97c48
编写于
11月 30, 2022
作者:
O
oasis-cloud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: popover demo 增加白色底
上级
93f9eb3e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
236 addition
and
211 deletion
+236
-211
src/packages/popover/demo.scss
src/packages/popover/demo.scss
+8
-0
src/packages/popover/demo.taro.tsx
src/packages/popover/demo.taro.tsx
+112
-104
src/packages/popover/demo.tsx
src/packages/popover/demo.tsx
+116
-107
未找到文件。
src/packages/popover/demo.scss
浏览文件 @
84d97c48
...
...
@@ -24,3 +24,11 @@
.customContent
.popover-content
{
width
:
200px
;
}
.demo-cell-popove
{
flex-wrap
:
wrap
;
}
.nut-popover
{
height
:
38px
;
}
src/packages/popover/demo.taro.tsx
浏览文件 @
84d97c48
import
React
,
{
useRef
,
useState
}
from
'
react
'
import
{
Button
,
Icon
,
Popover
}
from
'
@/packages/nutui.react.taro
'
import
{
Button
,
Icon
,
Popover
,
Cell
}
from
'
@/packages/nutui.react.taro
'
import
'
@/packages/popover/demo.scss
'
interface
List
{
...
...
@@ -130,6 +130,7 @@ const BadgeDemo = () => {
<>
<
div
className
=
"demo"
>
<
h2
>
基础用法
</
h2
>
<
Cell
>
<
Popover
visible
=
{
lightTheme
}
onClick
=
{
()
=>
{
...
...
@@ -154,8 +155,9 @@ const BadgeDemo = () => {
暗黑风格
</
Button
>
</
Popover
>
</
Cell
>
<
h2
>
选项配置
</
h2
>
<
Cell
>
<
Popover
visible
=
{
showIcon
}
theme
=
"dark"
...
...
@@ -181,8 +183,9 @@ const BadgeDemo = () => {
禁用选项
</
Button
>
</
Popover
>
</
Cell
>
<
h2
>
自定义内容
</
h2
>
<
Cell
>
<
Popover
visible
=
{
customized
}
onClick
=
{
()
=>
{
...
...
@@ -204,7 +207,10 @@ const BadgeDemo = () => {
key
=
{
item
.
name
}
>
<
Icon
name
=
{
item
.
name
}
size
=
"15"
/>
<
div
className
=
"self-content-desc"
style
=
{
selfContentDesc
}
>
<
div
className
=
"self-content-desc"
style
=
{
selfContentDesc
}
>
{
item
.
desc
}
</
div
>
</
div
>
...
...
@@ -215,7 +221,7 @@ const BadgeDemo = () => {
''
)
}
</
Popover
>
</
Cell
>
<
h2
className
=
"demoClass"
>
位置自定义
</
h2
>
<
Popover
...
...
@@ -231,6 +237,7 @@ const BadgeDemo = () => {
<
div
className
=
"brick"
/>
</
Popover
>
<
Cell
className
=
"demo-cell-popover"
>
<
div
className
=
"customButtonBox"
>
{
customLocation
.
current
.
map
((
location
,
i
)
=>
{
const
k
=
Object
.
keys
(
location
)[
0
]
as
any
...
...
@@ -240,17 +247,18 @@ const BadgeDemo = () => {
key
=
{
i
}
type
=
"primary"
shape
=
"square"
style
=
{
{
width
:
'
16
0px
'
,
marginBottom
:
'
8px
'
}
}
style
=
{
{
width
:
'
14
0px
'
,
marginBottom
:
'
8px
'
}
}
onClick
=
{
()
=>
{
setCustomLocationName
(
k
)
setCustomLocationShow
(
!
customLocationShow
)
}
}
>
{
k
}
弹出
{
k
}
</
Button
>
)
})
}
</
div
>
</
Cell
>
</
div
>
</>
)
...
...
src/packages/popover/demo.tsx
浏览文件 @
84d97c48
...
...
@@ -3,6 +3,7 @@ import { useTranslate } from '../../sites/assets/locale'
import
{
Popover
}
from
'
./popover
'
import
Button
from
'
@/packages/button
'
import
Icon
from
'
@/packages/icon
'
import
Cell
from
'
@/packages/cell
'
interface
T
{
[
props
:
string
]:
string
...
...
@@ -197,6 +198,7 @@ const BadgeDemo = () => {
<
style
>
{
styles
}
</
style
>
<
div
className
=
"demo"
>
<
h2
>
{
translated
.
title
}
</
h2
>
<
Cell
>
<
Popover
visible
=
{
lightTheme
}
onClick
=
{
()
=>
{
...
...
@@ -221,8 +223,10 @@ const BadgeDemo = () => {
{
translated
.
dark
}
</
Button
>
</
Popover
>
</
Cell
>
<
h2
>
{
translated
.
title1
}
</
h2
>
<
Cell
>
<
Popover
visible
=
{
showIcon
}
theme
=
"dark"
...
...
@@ -248,8 +252,9 @@ const BadgeDemo = () => {
{
translated
.
disableAction
}
</
Button
>
</
Popover
>
</
Cell
>
<
h2
>
{
translated
.
content
}
</
h2
>
<
Cell
>
<
Popover
visible
=
{
customized
}
onClick
=
{
()
=>
{
...
...
@@ -271,7 +276,10 @@ const BadgeDemo = () => {
key
=
{
item
.
name
}
>
<
Icon
name
=
{
item
.
name
}
size
=
"15"
/>
<
div
className
=
"self-content-desc"
style
=
{
selfContentDesc
}
>
<
div
className
=
"self-content-desc"
style
=
{
selfContentDesc
}
>
{
item
.
desc
}
</
div
>
</
div
>
...
...
@@ -282,7 +290,7 @@ const BadgeDemo = () => {
''
)
}
</
Popover
>
</
Cell
>
<
h2
className
=
"demoClass"
>
{
translated
.
title3
}
</
h2
>
<
Popover
...
...
@@ -297,7 +305,7 @@ const BadgeDemo = () => {
>
<
div
className
=
"brick"
/>
</
Popover
>
<
Cell
className
=
"demo-cell-popover"
>
<
div
className
=
"customButtonBox"
>
{
customLocation
.
current
.
map
((
location
,
i
)
=>
{
const
k
=
Object
.
keys
(
location
)[
0
]
as
any
...
...
@@ -307,17 +315,18 @@ const BadgeDemo = () => {
key
=
{
i
}
type
=
"primary"
shape
=
"square"
style
=
{
{
width
:
'
16
0px
'
,
marginBottom
:
'
8px
'
}
}
style
=
{
{
width
:
'
14
0px
'
,
marginBottom
:
'
8px
'
}
}
onClick
=
{
()
=>
{
setCustomLocationName
(
k
)
setCustomLocationShow
(
!
customLocationShow
)
}
}
>
{
k
}
{
translated
.
popup
}
{
k
}
</
Button
>
)
})
}
</
div
>
</
Cell
>
</
div
>
</>
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录