Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
d34e38a9
Commit
d34e38a9
authored
Sep 28, 2017
by
杨奕
Committed by
Black Wayne
Sep 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs style groundwork (#7281)
* docs style groundwork * update docs style
parent
fa6580e7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
109 additions
and
26 deletions
+109
-26
CHANGELOG.en-US.md
CHANGELOG.en-US.md
+1
-1
CHANGELOG.zh-CN.md
CHANGELOG.zh-CN.md
+1
-1
examples/app.vue
examples/app.vue
+21
-2
examples/bus.js
examples/bus.js
+2
-0
examples/components/footer-nav.vue
examples/components/footer-nav.vue
+1
-1
examples/components/header.vue
examples/components/header.vue
+23
-7
examples/pages/template/component.tpl
examples/pages/template/component.tpl
+60
-14
No files found.
CHANGELOG.en-US.md
View file @
d34e38a9
...
...
@@ -641,4 +641,4 @@ Breaking change
*2016-11-9*
Element 1.0.0 released.
-
Element 1.0.0 released.
CHANGELOG.zh-CN.md
View file @
d34e38a9
...
...
@@ -777,4 +777,4 @@
*2016-08-30*
Element 1.0.0-rc.1 发布
-
Element 1.0.0-rc.1 发布
examples/app.vue
View file @
d34e38a9
...
...
@@ -11,6 +11,22 @@
#app
{
height
:
100%
;
@when
component
{
.main-cnt
{
padding
:
0
;
margin-top
:
0
;
min-height
:
auto
;
}
.headerWrapper
{
position
:
fixed
;
width
:
100%
;
left
:
0
;
top
:
0
;
z-index
:
1000
;
border-bottom
:
solid
1px
#ccc
;
}
}
}
body
{
...
...
@@ -167,12 +183,12 @@
</
style
>
<
template
>
<div
id=
"app"
>
<div
id=
"app"
:class=
"
{ 'is-component': isComponent }"
>
<main-header
v-if=
"lang !== 'play'"
></main-header>
<div
class=
"main-cnt"
>
<router-view></router-view>
</div>
<main-footer
v-if=
"lang !== 'play'"
></main-footer>
<main-footer
v-if=
"lang !== 'play'
&& !isComponent
"
></main-footer>
</div>
</
template
>
...
...
@@ -188,6 +204,9 @@
computed
:
{
lang
()
{
return
this
.
$route
.
path
.
split
(
'
/
'
)[
1
]
||
'
zh-CN
'
;
},
isComponent
()
{
return
/^component-/
.
test
(
this
.
$route
.
name
||
''
);
}
},
...
...
examples/bus.js
0 → 100644
View file @
d34e38a9
import
Vue
from
'
vue
'
;
export
default
new
Vue
();
examples/components/footer-nav.vue
View file @
d34e38a9
...
...
@@ -90,7 +90,7 @@
methods
:
{
setNav
()
{
let
nav
=
navConfig
[
this
.
lang
];
this
.
nav
=
nav
[
0
].
children
.
concat
(
nav
[
1
]
);
this
.
nav
=
[
nav
[
0
]].
concat
(
nav
[
2
].
children
);
nav
[
3
].
groups
.
map
(
group
=>
group
.
list
).
forEach
(
list
=>
{
this
.
nav
=
this
.
nav
.
concat
(
list
);
});
...
...
examples/components/header.vue
View file @
d34e38a9
<
style
scoped
>
.headerWrapper
{
height
:
80px
;
transition
:
transform
.3s
;
&.is-hidden
{
transform
:
translateY
(
-80px
);
}
}
.header
{
height
:
80px
;
...
...
@@ -25,7 +30,7 @@
font-weight
:
normal
;
a
{
color
:
#
fff
;
color
:
#
333
;
text-decoration
:
none
;
display
:
block
;
}
...
...
@@ -90,7 +95,7 @@
a
{
text-decoration
:
none
;
color
:
#
fff
;
color
:
#
333
;
display
:
block
;
padding
:
0
20px
;
opacity
:
.8
;
...
...
@@ -157,7 +162,9 @@
}
</
style
>
<
template
>
<div
class=
"headerWrapper"
>
<div
class=
"headerWrapper"
:class=
"
{ 'is-hidden': !visible }">
<header
class=
"header"
ref=
"header"
:style=
"headerStyle"
...
...
@@ -216,6 +223,7 @@
</div>
</
template
>
<
script
>
import
bus
from
'
../bus
'
;
import
compoLang
from
'
../i18n/component.json
'
;
export
default
{
...
...
@@ -223,7 +231,8 @@
return
{
active
:
''
,
isHome
:
false
,
headerStyle
:
{}
headerStyle
:
{},
visible
:
true
};
},
watch
:
{
...
...
@@ -231,6 +240,10 @@
immediate
:
true
,
handler
()
{
this
.
isHome
=
/^home/
.
test
(
this
.
$route
.
name
);
if
(
/^component/
.
test
(
this
.
$route
.
name
))
{
this
.
headerStyle
.
backgroundColor
=
'
#fff
'
;
return
;
}
this
.
headerStyle
.
backgroundColor
=
`rgba(32, 160, 255,
${
this
.
isHome
?
'
0
'
:
'
1
'
}
)`
;
}
}
...
...
@@ -250,11 +263,14 @@
this
.
$router
.
push
(
this
.
$route
.
path
.
replace
(
this
.
lang
,
targetLang
));
}
},
created
()
{
bus
.
$on
(
'
toggleHeader
'
,
visible
=>
{
this
.
visible
=
visible
;
});
},
mounted
()
{
function
scroll
(
fn
)
{
window
.
addEventListener
(
'
scroll
'
,
()
=>
{
fn
();
},
false
);
window
.
addEventListener
(
'
scroll
'
,
fn
,
false
);
}
scroll
(()
=>
{
if
(
this
.
isHome
)
{
...
...
examples/pages/template/component.tpl
View file @
d34e38a9
<style>
.page-component
{
padding-bottom
:
95px
;
box-sizing
:
border-box
;
.content
{
margin-left
:
-1px
;
height
:
100%
;
&.page-container
{
padding
:
0
;
}
.page-component__nav
{
width
:
240px
;
position
:
fixed
;
top
:
0
;
bottom
:
0
;
overflow
:
auto
;
padding-top
:
80px
;
transition
:
padding-top
.3s
;
&.is-extended
{
padding-top
:
0
;
}
}
.side-nav
{
height
:
100%
;
padding-top
:
50px
;
padding-bottom
:
50px
;
padding-right
:
0
;
&
>
ul
{
padding-bottom
:
50px
;
}
}
.page-component__content
{
padding-left
:
270px
;
}
.content
{
padding-top
:
130px
;
>
{
h3
{
margin
:
45px
0
20px
;
...
...
@@ -83,15 +116,15 @@
</style>
<template>
<div
class=
"page-container page-component"
>
<
el-row>
<el-col
:xs=
"24"
:sm=
"6"
>
<side-nav
:data=
"navsData[lang]"
:base=
"`/${ lang }/component`"
></side-nav
>
<
/el-col
>
<el-col
:xs=
"24"
:sm=
"18"
>
<router-view
class=
"content"
></router-view
>
<footer-nav></footer-nav
>
<
/el-col
>
</
el-row
>
<
div
class=
"page-component__nav"
:class=
"{ 'is-extended': !showHeader }"
>
<
side-nav
:data=
"navsData[lang]"
:base=
"`/${ lang }/component`"
></side-nav
>
</div
>
<div
class=
"page-component__content"
>
<router-view
class=
"content"
></router-view
>
<
footer-nav></footer-nav
>
</
div
>
<transition
name=
"back-top-fade"
>
<div
class=
"page-component-up"
...
...
@@ -106,6 +139,7 @@
</div>
</template>
<script>
import
bus
from
'
../../bus
'
;
import
navsData
from
'
../../nav.config.json
'
;
import
throttle
from
'
throttle-debounce/throttle
'
;
...
...
@@ -115,7 +149,9 @@
lang
:
this
.
$route
.
meta
.
lang
,
navsData
,
hover
:
false
,
showBackToTop
:
false
showBackToTop
:
false
,
scrollTop
:
0
,
showHeader
:
true
};
},
methods
:
{
...
...
@@ -126,7 +162,17 @@
document
.
documentElement
.
scrollTop
=
0
;
},
handleScroll
()
{
this
.
showBackToTop
=
(
document
.
body
.
scrollTop
||
document
.
documentElement
.
scrollTop
)
>=
0.5
*
document
.
body
.
clientHeight
;
const
scrollTop
=
document
.
body
.
scrollTop
||
document
.
documentElement
.
scrollTop
;
this
.
showBackToTop
=
scrollTop
>=
0.5
*
document
.
body
.
clientHeight
;
if
(
this
.
showHeader
!==
this
.
scrollTop
>
scrollTop
)
{
this
.
showHeader
=
this
.
scrollTop
>
scrollTop
;
bus
.
$emit
(
'
toggleHeader
'
,
this
.
showHeader
);
}
if
(
scrollTop
===
0
)
{
this
.
showHeader
=
true
;
bus
.
$emit
(
'
toggleHeader
'
,
this
.
showHeader
);
}
this
.
scrollTop
=
scrollTop
;
}
},
mounted
()
{
...
...
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