Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
cube-ui
提交
0f5e8bff
C
cube-ui
项目概览
DiDi
/
cube-ui
12 个月 前同步成功
通知
34
Star
9078
Fork
1508
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cube-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0f5e8bff
编写于
4月 18, 2018
作者:
D
dolymood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
popup should be pointer-events: none without mask
上级
70906b8d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
6 deletion
+20
-6
src/components/popup/popup.vue
src/components/popup/popup.vue
+18
-4
test/unit/specs/poup.spec.js
test/unit/specs/poup.spec.js
+2
-2
未找到文件。
src/components/popup/popup.vue
浏览文件 @
0f5e8bff
<
template
>
<div
class=
"cube-popup"
:style=
"
{'z-index': zIndex}" :class="
type
Class" v-show="isVisible">
<div
class=
"cube-popup-mask"
v-show=
"mask"
@
click=
"maskClick"
>
<div
class=
"cube-popup"
:style=
"
{'z-index': zIndex}" :class="
root
Class" v-show="isVisible">
<div
class=
"cube-popup-mask"
@
click=
"maskClick"
>
<slot
name=
"mask"
></slot>
</div>
<div
class=
"cube-popup-container"
:class=
"
{'cube-popup-center': center}">
...
...
@@ -44,8 +44,14 @@
}
},
computed
:
{
typeClass
()
{
return
this
.
type
?
`cube-
${
this
.
type
}
`
:
''
rootClass
()
{
const
cls
=
{
'
cube-popup_mask
'
:
this
.
mask
}
if
(
this
.
type
)
{
cls
[
`cube-
${
this
.
type
}
`
]
=
true
}
return
cls
}
},
methods
:
{
...
...
@@ -65,14 +71,21 @@
top: 0
bottom: 0
z-index: 100
pointer-events: none
.cube-popup_mask
pointer-events: auto
.cube-popup-mask
display: block
.cube-popup-mask, .cube-popup-container
position: absolute
width: 100%
height: 100%
.cube-popup-mask
display: none
overflow: hidden
background-color: $popup-mask-bgc
opacity: $popup-mask-opacity
pointer-events: auto
// fix some android webview opacity render bug
&::before
content: "."
...
...
@@ -90,6 +103,7 @@
width: 100%
box-sizing: border-box
transform: translate(-100%, -100%)
pointer-events: auto
.cube-popup-center
.cube-popup-content
position: absolute
...
...
test/unit/specs/poup.spec.js
浏览文件 @
0f5e8bff
...
...
@@ -23,7 +23,7 @@ describe('Popup', () => {
}
})
expect
(
vm
.
$el
.
className
)
.
to
.
equal
(
'
cube-popup
'
)
.
to
.
equal
(
'
cube-popup
cube-popup_mask
'
)
})
it
(
'
should render correct contents
'
,
()
=>
{
vm
=
instantiateComponent
(
Vue
,
Popup
,
{
...
...
@@ -34,7 +34,7 @@ describe('Popup', () => {
})
vm
.
show
()
expect
(
vm
.
$el
.
className
)
.
to
.
equal
(
'
cube-popup cube-xx
'
)
.
to
.
equal
(
'
cube-popup cube-
popup_mask cube-
xx
'
)
expect
(
vm
.
$el
.
querySelector
(
'
.cube-popup-container
'
).
className
)
.
to
.
equal
(
'
cube-popup-container cube-popup-center
'
)
expect
(
vm
.
$el
.
querySelector
(
'
.cube-popup-content
'
).
innerHTML
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录