Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
easyUI
hls-easy-ui
Commits
4b7de2b3
Commit
4b7de2b3
authored
May 07, 2019
by
Nature
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s-tab添加横向滚动支持
parent
47a7d413
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
52 deletions
+127
-52
index.vue
packages/components/STab/index.vue
+52
-6
tab-item.vue
packages/components/STab/tab-item.vue
+23
-22
index.vue
packages/components/Swipe/index.vue
+29
-16
hlsPopup.vue
src/pages/hlsPopup.vue
+23
-8
No files found.
packages/components/STab/index.vue
View file @
4b7de2b3
<
template
>
<
template
>
<section
:class=
"[c(),tabCss, cusClass]"
>
<section
:class=
"[c(),tabCss, cusClass,overFlow]"
>
<slot/>
<section
:style=
"transform"
class=
"tab-content"
>
<slot/>
</section>
</section>
</section>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
base
}
from
'../../common/mixins'
import
{
base
}
from
'../../common/mixins'
import
stabItem
from
'./tab-item'
import
stabItem
from
'./tab-item'
export
default
{
export
default
{
name
:
'SwitchTab'
,
name
:
'SwitchTab'
,
mixins
:
[
base
],
mixins
:
[
base
],
component
:
{
stabItem
},
component
:
{
stabItem
},
props
:
{
props
:
{
position
:
{
position
:
{
type
:
String
,
type
:
String
,
...
@@ -28,15 +30,24 @@ export default {
...
@@ -28,15 +30,24 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
,
},
},
overflowX
:
{
type
:
Boolean
,
default
:
false
,
},
},
},
data
()
{
data
()
{
return
{
return
{
items
:
[],
items
:
[],
length
:
''
,
length
:
''
,
activedIndex
:
''
,
activedIndex
:
''
,
deviceWidth
:
window
.
innerWidth
,
translate
:
0
,
}
}
},
},
computed
:
{
computed
:
{
overFlow
()
{
return
this
.
overflowX
?
'auto-overflow-x'
:
''
},
tabCss
()
{
tabCss
()
{
return
this
.
position
===
'top'
?
this
.
c
(
'top'
)
:
this
.
c
(
'bottom'
)
return
this
.
position
===
'top'
?
this
.
c
(
'top'
)
:
this
.
c
(
'bottom'
)
},
},
...
@@ -54,37 +65,72 @@ export default {
...
@@ -54,37 +65,72 @@ export default {
}
}
return
vm
.
index
return
vm
.
index
},
},
transform
()
{
return
{
transform
:
'translateX('
+
this
.
translate
+
'px'
+
')'
,
}
},
},
},
mounted
()
{
mounted
()
{
let
vm
=
this
let
vm
=
this
this
.
items
[
vm
.
current
].
$el
.
classList
.
add
(
'activated'
)
this
.
items
[
vm
.
current
].
$el
.
classList
.
add
(
'activated'
)
this
.
scrollToActiveTab
(
vm
.
current
,
this
.
items
[
vm
.
current
].
$el
.
clientWidth
)
},
},
methods
:
{
methods
:
{
actived
(
index
)
{
actived
(
index
,
clientWidth
)
{
this
.
activedIndex
=
index
this
.
activedIndex
=
index
this
.
$emit
(
'tabClick'
,
index
)
this
.
$emit
(
'tabClick'
,
index
)
this
.
scrollToActiveTab
(
index
,
clientWidth
)
},
scrollToActiveTab
(
index
,
width
)
{
index
+=
1
let
vm
=
this
let
count
=
Math
.
floor
(
vm
.
deviceWidth
/
width
)
let
overFlowWinth
=
vm
.
deviceWidth
-
count
*
width
let
num
if
(
index
>
count
)
{
num
=
index
-
count
}
else
{
num
=
0
}
if
(
num
===
0
)
{
vm
.
translate
=
-
num
*
width
}
else
{
vm
.
translate
=
-
num
*
width
+
overFlowWinth
}
},
},
},
},
}
}
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.auto-overflow-x {
overflow-x: auto;
}
.hls-switch-tab {
.hls-switch-tab {
width: 100%;
width: 100%;
position: absolute;
position: absolute;
z-index: 1;
z-index: 1;
display: flex;
display: flex;
justify-content: space-around;
//
justify-content: space-around;
height: 40px;
height: 40px;
background-color: #fff;
background-color: #fff;
&-top {
&-top {
top: 0;
top: 0;
&:after {
&:after {
.setBottomLine();
.setBottomLine();
}
}
}
}
&-bottom {
&-bottom {
bottom: 0;
bottom: 0;
&:before {
&:before {
.setTopLine();
.setTopLine();
}
}
...
...
packages/components/STab/tab-item.vue
View file @
4b7de2b3
<
template
>
<
template
>
<section
class=
"tab-content"
@
click=
"titleClick"
>
<section
class=
"h-tab-item"
@
click=
"titleClick"
>
<section
class=
"h-tab-item"
>
<div
class=
"h-item"
>
<div
class=
"h-item"
>
<slot/>
<slot/>
</div>
</div>
</section>
<div
v-show=
"showDivider"
class=
"tab-divider"
/>
<div
v-show=
"showDivider"
class=
"tab-divider"
/>
</section>
</section>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'TabItem'
,
name
:
'TabItem'
,
data
()
{
data
()
{
return
{}
return
{
}
},
},
computed
:
{
computed
:
{
showDivider
()
{
showDivider
()
{
...
@@ -36,8 +37,10 @@ export default {
...
@@ -36,8 +37,10 @@ export default {
let
clickIndex
=
Number
(
event
.
currentTarget
.
getAttribute
(
'data-index'
))
let
clickIndex
=
Number
(
event
.
currentTarget
.
getAttribute
(
'data-index'
))
event
.
currentTarget
.
classList
.
remove
(
'activated'
)
event
.
currentTarget
.
classList
.
remove
(
'activated'
)
event
.
currentTarget
.
classList
.
add
(
'activated'
)
event
.
currentTarget
.
classList
.
add
(
'activated'
)
vm
.
$parent
.
actived
(
clickIndex
)
let
clientWidth
=
event
.
currentTarget
.
clientWidth
vm
.
$parent
.
actived
(
clickIndex
,
clientWidth
)
},
},
},
},
}
}
</
script
>
</
script
>
...
@@ -48,7 +51,6 @@ export default {
...
@@ -48,7 +51,6 @@ export default {
.tab-content {
.tab-content {
width: 100%;
width: 100%;
display: flex;
display: flex;
justify-content: space-around;
align-items: center;
align-items: center;
.h-tab-item {
.h-tab-item {
...
@@ -57,6 +59,7 @@ export default {
...
@@ -57,6 +59,7 @@ export default {
display: flex;
display: flex;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
.h-item {
.h-item {
//width: 100%;
//width: 100%;
font-size: 14px;
font-size: 14px;
...
@@ -67,27 +70,25 @@ export default {
...
@@ -67,27 +70,25 @@ export default {
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
padding: 0 3px;
padding: 0 3px;
border-bottom: 1px solid rgba(255,
255,255,
.0); /*no*/
border-bottom: 1px solid rgba(255,
255, 255,
.0); /*no*/
}
}
}
&.activated {
.tab-divider {
width: 1px; /*no*/
height: 50%;
background-color: rgb(214, 217, 218);
}
&.activated {
.h-tab-item {
.h-item {
.h-item {
color: #1e8ceb;
color: #1e8ceb;
border-bottom: 1px solid #1e8ceb; /*no*/
border-bottom: 1px solid #1e8ceb; /*no*/
}
}
}
}
}
&:last-child {
.tab-divider {
.tab-divider {
width: 0px;
width: 1px; /*no*/
height: 50%;
background-color: rgb(214, 217, 218);
}
&:last-child {
.tab-divider {
width: 0px;
}
}
}
}
}
}
}
...
...
packages/components/Swipe/index.vue
View file @
4b7de2b3
...
@@ -90,6 +90,14 @@ export default {
...
@@ -90,6 +90,14 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
true
,
default
:
true
,
},
},
defaultWidth
:
{
type
:
Number
,
default
:
0
,
},
defaultHeight
:
{
type
:
Number
,
default
:
0
,
},
cusClass
:
{
cusClass
:
{
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
...
@@ -161,26 +169,31 @@ export default {
...
@@ -161,26 +169,31 @@ export default {
init
()
{
init
()
{
let
vm
=
this
let
vm
=
this
vm
.
clear
()
vm
.
clear
()
if
(
vm
.
defaultWidth
)
{
if
(
vm
.
$el
)
{
vm
.
width
=
vm
.
defaultWidth
vm
.
width
=
vm
.
$el
.
offsetWidth
||
document
.
documentElement
.
offsetWidth
}
else
if
(
vm
.
defaultHeight
)
{
vm
.
h
eight
=
vm
.
$el
.
offsetHeight
||
document
.
documentElement
.
offse
tHeight
vm
.
h
ight
=
vm
.
defaul
tHeight
}
else
{
}
else
{
// 获取窗口宽度
if
(
vm
.
$el
)
{
if
(
window
.
innerWidth
)
{
vm
.
width
=
window
.
innerWidth
}
else
if
((
document
.
body
)
&&
(
document
.
body
.
clientWidth
))
{
vm
.
width
=
vm
.
$el
.
offsetWidth
||
document
.
documentElement
.
offsetWidth
vm
.
width
=
document
.
body
.
clientWidth
vm
.
height
=
vm
.
$el
.
offsetHeight
||
document
.
documentElement
.
offsetHeight
}
else
{
// 获取窗口宽度
if
(
window
.
innerWidth
)
{
vm
.
width
=
window
.
innerWidth
}
else
if
((
document
.
body
)
&&
(
document
.
body
.
clientWidth
))
{
vm
.
width
=
document
.
body
.
clientWidth
}
if
(
window
.
innerHeight
)
{
vm
.
height
=
window
.
innerHeight
}
else
if
((
document
.
body
)
&&
(
document
.
body
.
clientHeight
))
{
vm
.
height
=
document
.
body
.
clientHeight
}
// 通过深入Document内部对body进行检测,获取窗口大小
if
(
document
.
documentElement
&&
document
.
documentElement
.
clientHeight
&&
document
.
documentElement
.
clientWidth
)
{
vm
.
height
=
document
.
documentElement
.
clientHeight
vm
.
width
=
document
.
documentElement
.
clientWidth
}
}
}
if
(
window
.
innerHeight
)
{
vm
.
height
=
window
.
innerHeight
}
else
if
((
document
.
body
)
&&
(
document
.
body
.
clientHeight
))
{
vm
.
height
=
document
.
body
.
clientHeight
}
if
(
!
vm
.
width
)
{
// 通过深入Document内部对body进行检测,获取窗口大小
vm
.
width
=
375
if
(
document
.
documentElement
&&
document
.
documentElement
.
clientHeight
&&
document
.
documentElement
.
clientWidth
)
{
vm
.
height
=
667
vm
.
height
=
document
.
documentElement
.
clientHeight
vm
.
width
=
document
.
documentElement
.
clientWidth
}
}
}
}
if
(
!
vm
.
width
)
{
vm
.
width
=
375
vm
.
height
=
667
}
this
.
active
=
this
.
index
this
.
active
=
this
.
index
this
.
offset
=
this
.
count
>
1
?
-
this
.
size
*
this
.
active
:
0
this
.
offset
=
this
.
count
>
1
?
-
this
.
size
*
this
.
active
:
0
this
.
swipes
.
forEach
(
swipe
=>
{
this
.
swipes
.
forEach
(
swipe
=>
{
...
...
src/pages/hlsPopup.vue
View file @
4b7de2b3
...
@@ -9,12 +9,20 @@
...
@@ -9,12 +9,20 @@
操作
操作
</div>
</div>
</h-header>
</h-header>
<!--
<s-tab
@
tabClick=
"stablick"
cusClass=
"popup-tab"
>
<!--
<s-tab
:overflowX=
"true"
:showDivider=
"true"
class=
"has-header"
:defaultActive=
"6"
>
<tab-item>
测试
</tab-item>
<tab-item>
工商资料
</tab-item>
<tab-item>
你好
</tab-item>
<tab-item>
股东成员
</tab-item>
<tab-item>
再见
</tab-item>
<tab-item>
对外投资
</tab-item>
<tab-item>
按钮
</tab-item>
<tab-item>
工商变更
</tab-item>
</s-tab>
-->
<tab-item>
企业年报
</tab-item>
<tab-item>
关联情报
</tab-item>
<tab-item>
开庭公告
</tab-item>
<tab-item>
裁判文书
</tab-item>
<tab-item>
执行记录
</tab-item>
<tab-item>
失信记录
</tab-item>
<tab-item>
涉诉公告
</tab-item>
<tab-item>
司法协助
</tab-item>
</s-tab>
-->
<h-content
<h-content
class=
"has-header has-footer"
>
class=
"has-header has-footer"
>
<h-button
class=
"button-class"
type=
"primary"
@
click
.
native=
"showLoading"
>
showLoading
</h-button>
<h-button
class=
"button-class"
type=
"primary"
@
click
.
native=
"showLoading"
>
showLoading
</h-button>
...
@@ -72,7 +80,7 @@
...
@@ -72,7 +80,7 @@
<h-button
class=
"button-class radius-small"
disabled
>
基础按钮(禁用)
</h-button>
<h-button
class=
"button-class radius-small"
disabled
>
基础按钮(禁用)
</h-button>
<h2
class=
"item-title"
>
Swip基础使用
</h2>
<h2
class=
"item-title"
>
Swip基础使用
</h2>
<swipe
:interval=
"5000"
@
start=
"start"
@
move=
"move"
@
change=
"change"
>
<swipe
:interval=
"5000"
@
start=
"start"
@
move=
"move"
@
change=
"change"
:defaultWidth=
"200"
>
<swipe-item>
<swipe-item>
<div
:style=
"
{'background': bgColor[0]}" class="item-bg">0
</div>
<div
:style=
"
{'background': bgColor[0]}" class="item-bg">0
</div>
</swipe-item>
</swipe-item>
...
@@ -85,7 +93,7 @@
...
@@ -85,7 +93,7 @@
</swipe>
</swipe>
<h2
class=
"item-title"
>
纵向滚动
</h2>
<h2
class=
"item-title"
>
纵向滚动
</h2>
<swipe
:vertical=
"true"
style=
"height: 200px"
>
<swipe
:vertical=
"true"
style=
"height: 200px"
>
<swipe-item
v-for=
"key in count"
:key=
"key"
:style=
"
{'background': bgColor[key-1]}">
<swipe-item
v-for=
"key in count"
:key=
"key"
:style=
"
{'background': bgColor[key-1]}">
<div
class=
"item-bg"
>
{{
key
-
1
}}
</div>
<div
class=
"item-bg"
>
{{
key
-
1
}}
</div>
</swipe-item>
</swipe-item>
...
@@ -660,6 +668,13 @@ export default {
...
@@ -660,6 +668,13 @@ export default {
.hls-popup {
.hls-popup {
height: 100%;
height: 100%;
width: 100%;
width: 100%;
.hls-switch-tab {
.tab-content .h-tab-item .h-item{
width: 80px;
}
}
.vue-better-scroll__wrapper {
.vue-better-scroll__wrapper {
width: 100%;
width: 100%;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment