fix: remove useless picker hack (#485)

* fix: remove useless picker hack

* chore: remove ad

* chore: add loading
This commit is contained in:
zazzaz 2020-10-28 11:21:39 +08:00 committed by GitHub
parent 0ee70e64b5
commit 45b8986f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 21 deletions

View File

@ -110,7 +110,6 @@
@pick="onPick"
@select-range="setSelectionRange"
@set-picker-option="onSetPickerOption"
@mousedown.stop
></slot>
</template>
</el-popper>

View File

@ -5,7 +5,9 @@
<side-nav :data="navsData[lang]" :base="`/${ lang }/component`" />
</el-scrollbar>
<div class="page-component__content">
<div class="content-wrap">
<router-view class="content" />
</div>
<footer-nav />
</div>
<el-backtop
@ -174,6 +176,9 @@ export default {
padding-bottom: 100px;
box-sizing: border-box;
}
.content-wrap {
min-height: 500px;
}
.content {
padding-top: 50px;

View File

@ -17,27 +17,27 @@
<img src="~examples/assets/images/theme-index-red.png" alt="">
</div>
</div>
<div class="sponsors">
<!-- <div class="sponsors">
<a
v-show="lang !== 'zh-CN'"
class="sponsor"
href="https://tipe.io/?ref=element"
href="#"
target="_blank"
>
<img width="35px" src="~examples/assets/images/tipe.svg" alt="tipe.io">
<img width="35px" src="~examples/assets/images/xx.svg" alt="xx">
<div>
<p>Sponsored by Tipe.io</p>
<p>Next Generation API-first CMS</p>
<p>Sponsored by xx</p>
<p>xx</p>
</div>
</a>
<a class="sponsor" href="https://www.duohui.cn/?utm_source=element&utm_medium=web&utm_campaign=element-index" target="_blank">
<img width="45px" src="~examples/assets/images/duohui.svg" alt="duohui">
<a class="sponsor" href="#" target="_blank">
<img width="45px" src="~examples/assets/images/xx.svg" alt="xx">
<div>
<p>Sponsored by 多会</p>
<p>炫酷的新一代活动票务系统</p>
<p>Sponsored by xx</p>
<p>xx</p>
</div>
</a>
</div>
</div> -->
<div class="cards">
<ul class="container">
<li>

View File

@ -1,19 +1,35 @@
import { defineAsyncComponent } from 'vue'
import navConfig from './nav.config'
import langs from './i18n/route'
import navConfig from './nav.config'
const LoadingComponent = {
template: `<div v-loading="true" style="min-height: 500px; width: 100%;"></div>`,
}
const ErrorComponent = {
template: `
<div style="text-align: center;padding: 100px 0;">Loading error. Please refresh the page and try again</div>`,
}
const getAsyncComponent = func => {
return defineAsyncComponent({
loader: func,
delay: 0,
timeout: 30000,
errorComponent: ErrorComponent,
loadingComponent: LoadingComponent,
})
}
const LOAD_MAP = {
'zh-CN': name => {
return defineAsyncComponent(() => import(/* webpackChunkName: "zh-CN" */ `./pages/${name}.vue`))
return getAsyncComponent(() => import(/* webpackChunkName: "zh-CN" */ `./pages/${name}.vue`))
},
'en-US': name => {
return defineAsyncComponent(() => import(/* webpackChunkName: "en-US" */ `./pages/${name}.vue`))
return getAsyncComponent(() => import(/* webpackChunkName: "en-US" */ `./pages/${name}.vue`))
},
'es': name => {
return defineAsyncComponent(() => import(/* webpackChunkName: "es" */ `./pages/${name}.vue`))
return getAsyncComponent(() => import(/* webpackChunkName: "es" */ `./pages/${name}.vue`))
},
'fr-FR': name => {
return defineAsyncComponent(() => import(/* webpackChunkName: "fr-FR" */ `./pages/${name}.vue`))
return getAsyncComponent(() => import(/* webpackChunkName: "fr-FR" */ `./pages/${name}.vue`))
},
}
@ -23,16 +39,16 @@ const load = function(lang, path) {
const LOAD_DOCS_MAP = {
'zh-CN': path => {
return defineAsyncComponent(() => import(/* webpackChunkName: "DOCS zh-CN" */ `./docs/zh-CN${path}.md`))
return getAsyncComponent(() => import(/* webpackChunkName: "DOCS zh-CN" */ `./docs/zh-CN${path}.md`))
},
'en-US': path => {
return defineAsyncComponent(() => import(/* webpackChunkName: "DOCS en-US" */ `./docs/en-US${path}.md`))
return getAsyncComponent(() => import(/* webpackChunkName: "DOCS en-US" */ `./docs/en-US${path}.md`))
},
'es': path => {
return defineAsyncComponent(() => import(/* webpackChunkName: "DOCS es" */ `./docs/es${path}.md`))
return getAsyncComponent(() => import(/* webpackChunkName: "DOCS es" */ `./docs/es${path}.md`))
},
'fr-FR': path => {
return defineAsyncComponent(() => import(/* webpackChunkName: "DOCS fr-FR" */ `./docs/fr-FR${path}.md`))
return getAsyncComponent(() => import(/* webpackChunkName: "DOCS fr-FR" */ `./docs/fr-FR${path}.md`))
},
}