2016-07-27 14:15:02 +08:00
|
|
|
<style lang="css">
|
2016-11-01 18:28:20 +08:00
|
|
|
@import 'highlight.js/styles/color-brewer.css';
|
2016-07-27 14:15:02 +08:00
|
|
|
@import 'assets/styles/common.css';
|
2017-01-23 16:02:58 +08:00
|
|
|
@import 'assets/styles/fonts/style.css';
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
|
|
html, body {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2016-08-23 19:15:15 +08:00
|
|
|
height: 100%;
|
2017-10-09 10:42:42 +08:00
|
|
|
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
|
|
|
|
font-weight: 400;
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
|
|
|
&.is-component {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2016-07-27 14:15:02 +08:00
|
|
|
}
|
|
|
|
|
2016-08-23 19:15:15 +08:00
|
|
|
#app {
|
|
|
|
height: 100%;
|
2017-09-29 11:36:38 +08:00
|
|
|
|
|
|
|
@when component {
|
2017-09-30 15:50:04 +08:00
|
|
|
overflow-y: hidden;
|
|
|
|
|
2017-09-29 11:36:38 +08:00
|
|
|
.main-cnt {
|
|
|
|
padding: 0;
|
|
|
|
margin-top: 0;
|
2017-09-30 15:50:04 +08:00
|
|
|
height: 100%;
|
2017-09-29 11:36:38 +08:00
|
|
|
min-height: auto;
|
|
|
|
}
|
2017-10-09 10:42:42 +08:00
|
|
|
|
2017-09-29 11:36:38 +08:00
|
|
|
.headerWrapper {
|
|
|
|
position: fixed;
|
|
|
|
width: 100%;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
2017-09-29 15:37:50 +08:00
|
|
|
z-index: 1500;
|
2017-09-30 15:57:08 +08:00
|
|
|
|
|
|
|
.container {
|
|
|
|
padding: 0;
|
|
|
|
}
|
2017-09-29 11:36:38 +08:00
|
|
|
}
|
|
|
|
}
|
2016-08-23 16:57:58 +08:00
|
|
|
}
|
|
|
|
|
2017-01-12 17:24:02 +08:00
|
|
|
a {
|
2017-09-30 15:50:04 +08:00
|
|
|
color: #409EFF;
|
2017-01-23 16:02:58 +08:00
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
2017-03-24 15:38:31 +08:00
|
|
|
code {
|
|
|
|
background-color: #f9fafc;
|
|
|
|
padding: 0 4px;
|
|
|
|
border: 1px solid #eaeefb;
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
|
2017-01-23 16:02:58 +08:00
|
|
|
button, input, select, textarea {
|
|
|
|
font-family: inherit;
|
|
|
|
font-size: inherit;
|
|
|
|
line-height: inherit;
|
|
|
|
color: inherit;
|
2016-09-28 12:35:24 +08:00
|
|
|
}
|
|
|
|
|
2016-08-30 19:30:58 +08:00
|
|
|
.hljs {
|
2016-09-18 22:01:26 +08:00
|
|
|
line-height: 1.8;
|
|
|
|
font-family: Menlo, Monaco, Consolas, Courier, monospace;
|
|
|
|
font-size: 12px;
|
|
|
|
padding: 18px 24px;
|
2017-09-29 15:37:50 +08:00
|
|
|
background-color: #fafafa;
|
2016-09-18 22:01:26 +08:00
|
|
|
border: solid 1px #eaeefb;
|
2016-08-30 19:30:58 +08:00
|
|
|
margin-bottom: 25px;
|
2016-11-07 16:25:56 +08:00
|
|
|
border-radius: 4px;
|
2016-09-20 17:09:18 +08:00
|
|
|
-webkit-font-smoothing: auto;
|
2016-08-30 19:30:58 +08:00
|
|
|
}
|
|
|
|
|
2016-08-23 19:15:15 +08:00
|
|
|
.main-cnt {
|
|
|
|
margin-top: -80px;
|
2017-10-25 11:58:58 +08:00
|
|
|
padding: 80px 0 340px;
|
2016-07-27 14:15:02 +08:00
|
|
|
box-sizing: border-box;
|
2016-08-23 19:15:15 +08:00
|
|
|
min-height: 100%;
|
2016-07-27 14:15:02 +08:00
|
|
|
}
|
|
|
|
|
2016-08-25 15:54:45 +08:00
|
|
|
.container,
|
|
|
|
.page-container {
|
2016-09-13 20:02:33 +08:00
|
|
|
width: 1140px;
|
2017-10-16 14:07:24 +08:00
|
|
|
padding: 0;
|
2016-08-25 15:54:45 +08:00
|
|
|
margin: 0 auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.page-container {
|
|
|
|
padding-top: 55px;
|
|
|
|
|
|
|
|
h2 {
|
|
|
|
font-size: 28px;
|
|
|
|
color: #1f2d3d;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
h3 {
|
|
|
|
font-size: 22px;
|
|
|
|
}
|
|
|
|
h2, h3, h4, h5 {
|
|
|
|
font-weight: normal;
|
|
|
|
color: #1f2f3d;
|
2016-11-04 16:59:59 +08:00
|
|
|
|
|
|
|
&:hover a {
|
|
|
|
opacity: .4;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
float: left;
|
|
|
|
margin-left: -20px;
|
|
|
|
opacity: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
opacity: .4;
|
|
|
|
}
|
|
|
|
}
|
2016-08-25 15:54:45 +08:00
|
|
|
}
|
2017-03-24 15:38:31 +08:00
|
|
|
|
2016-08-25 15:54:45 +08:00
|
|
|
p {
|
|
|
|
font-size: 14px;
|
|
|
|
color: #5e6d82;
|
2017-03-24 15:38:31 +08:00
|
|
|
line-height: 1.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tip {
|
|
|
|
padding: 8px 16px;
|
|
|
|
background-color: #ECF8FF;
|
|
|
|
border-radius: 4px;
|
|
|
|
border-left: #50bfff 5px solid;
|
2017-09-29 15:37:50 +08:00
|
|
|
margin: 20px 0;
|
2017-03-24 15:38:31 +08:00
|
|
|
|
|
|
|
code {
|
2017-09-28 15:28:12 +08:00
|
|
|
background-color: rgba(255, 255, 255, .7);
|
2017-03-24 15:38:31 +08:00
|
|
|
color: #445368;
|
|
|
|
}
|
2016-08-25 15:54:45 +08:00
|
|
|
}
|
2017-07-24 19:09:36 +08:00
|
|
|
|
|
|
|
.warning {
|
2017-09-29 15:37:50 +08:00
|
|
|
padding: 8px 16px;
|
|
|
|
background-color: #fff6f7;
|
|
|
|
border-radius: 4px;
|
|
|
|
border-left: #FE6C6F 5px solid;
|
|
|
|
margin: 20px 0;
|
|
|
|
|
2017-07-24 19:09:36 +08:00
|
|
|
code {
|
2017-09-28 15:28:12 +08:00
|
|
|
background-color: rgba(255, 255, 255, .7);
|
2017-07-24 19:09:36 +08:00
|
|
|
color: #445368;
|
|
|
|
}
|
|
|
|
}
|
2016-07-27 14:15:02 +08:00
|
|
|
}
|
|
|
|
.demo {
|
|
|
|
margin: 20px 0;
|
|
|
|
}
|
2016-09-14 18:38:38 +08:00
|
|
|
@media (max-width: 1140px) {
|
|
|
|
.container,
|
|
|
|
.page-container {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
2016-11-18 16:49:07 +08:00
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
.container,
|
|
|
|
.page-container {
|
|
|
|
padding: 0 20px;
|
|
|
|
}
|
2017-10-03 16:46:07 +08:00
|
|
|
|
|
|
|
#app.is-component .headerWrapper .container {
|
|
|
|
padding: 0 12px;
|
|
|
|
}
|
2016-11-18 16:49:07 +08:00
|
|
|
}
|
2016-07-27 14:15:02 +08:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<template>
|
2017-09-29 11:36:38 +08:00
|
|
|
<div id="app" :class="{ 'is-component': isComponent }">
|
2016-11-13 02:34:39 +08:00
|
|
|
<main-header v-if="lang !== 'play'"></main-header>
|
2016-08-23 19:15:15 +08:00
|
|
|
<div class="main-cnt">
|
|
|
|
<router-view></router-view>
|
|
|
|
</div>
|
2017-09-29 11:36:38 +08:00
|
|
|
<main-footer v-if="lang !== 'play' && !isComponent"></main-footer>
|
2016-07-27 17:05:28 +08:00
|
|
|
</div>
|
2016-07-27 14:15:02 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2016-11-10 21:46:55 +08:00
|
|
|
import { use } from 'main/locale';
|
|
|
|
import zhLocale from 'main/locale/lang/zh-CN';
|
|
|
|
import enLocale from 'main/locale/lang/en';
|
|
|
|
use(location.href.indexOf('zh-CN') > -1 ? zhLocale : enLocale);
|
|
|
|
|
2016-07-27 14:15:02 +08:00
|
|
|
export default {
|
2016-09-08 18:11:18 +08:00
|
|
|
name: 'app',
|
2016-11-10 21:46:55 +08:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
lang() {
|
|
|
|
return this.$route.path.split('/')[1] || 'zh-CN';
|
2017-09-29 11:36:38 +08:00
|
|
|
},
|
|
|
|
isComponent() {
|
|
|
|
return /^component-/.test(this.$route.name || '');
|
2016-11-10 21:46:55 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
2017-10-28 15:54:12 +08:00
|
|
|
lang(val) {
|
|
|
|
if (val === 'zh-CN') {
|
|
|
|
this.suggestJump();
|
|
|
|
}
|
2016-11-10 21:46:55 +08:00
|
|
|
this.localize();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-11-04 16:59:59 +08:00
|
|
|
methods: {
|
2016-11-10 21:46:55 +08:00
|
|
|
localize() {
|
|
|
|
use(this.lang === 'zh-CN' ? zhLocale : enLocale);
|
2017-10-28 15:54:12 +08:00
|
|
|
},
|
|
|
|
suggestJump() {
|
|
|
|
const href = location.href;
|
|
|
|
const preferGithub = localStorage.getItem('PREFER_GITHUB');
|
|
|
|
if (href.indexOf('element-cn') > -1 || preferGithub) return;
|
|
|
|
setTimeout(() => {
|
|
|
|
this.$confirm('建议大陆用户访问部署在国内的站点,是否跳转?', '提示')
|
|
|
|
.then(() => {
|
|
|
|
location.href = location.href.replace('element.', 'element-cn.');
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
localStorage.setItem('PREFER_GITHUB', true);
|
|
|
|
});
|
|
|
|
}, 1000);
|
2016-11-04 16:59:59 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2016-11-10 21:46:55 +08:00
|
|
|
this.localize();
|
2017-10-28 15:54:12 +08:00
|
|
|
if (this.lang === 'zh-CN') {
|
|
|
|
this.suggestJump();
|
|
|
|
}
|
2017-10-27 11:30:04 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
const notified = localStorage.getItem('RELEASE_NOTIFIED');
|
|
|
|
if (!notified) {
|
|
|
|
const h = this.$createElement;
|
|
|
|
const title = this.lang === 'zh-CN'
|
|
|
|
? '2.0 正式发布'
|
|
|
|
: '2.0 available now';
|
|
|
|
const messages = this.lang === 'zh-CN'
|
|
|
|
? ['点击', '这里', '查看详情']
|
|
|
|
: ['Click ', 'here', ' to learn more'];
|
|
|
|
this.$notify({
|
|
|
|
title,
|
|
|
|
duration: 0,
|
|
|
|
message: h('span', [
|
|
|
|
messages[0],
|
|
|
|
h('a', {
|
|
|
|
attrs: {
|
|
|
|
target: '_blank',
|
|
|
|
href: `https://github.com/ElemeFE/element/issues/${ this.lang === 'zh-CN' ? '7755' : '7756' }`
|
|
|
|
}
|
|
|
|
}, messages[1]),
|
|
|
|
messages[2]
|
|
|
|
]),
|
|
|
|
onClose() {
|
|
|
|
localStorage.setItem('RELEASE_NOTIFIED', 1);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, 3500);
|
2016-09-08 18:11:18 +08:00
|
|
|
}
|
2016-07-27 14:15:02 +08:00
|
|
|
};
|
|
|
|
</script>
|