Doc: improve iframe load speed

This commit is contained in:
陈嘉涵
2017-09-04 13:01:58 +08:00
parent 8a951895f8
commit 225df48ba5
9 changed files with 83 additions and 43 deletions
+6 -4
View File
@@ -1,6 +1,6 @@
<template>
<div class="app">
<zan-doc :simulator="simulatorSrc" :config="config">
<zan-doc :simulator="simulator" :config="config">
<router-view></router-view>
</zan-doc>
</div>
@@ -12,12 +12,14 @@ import docConfig from './doc.config';
export default {
data() {
return {
simulator: this.getSimulatorPath(),
config: docConfig['zh-CN']
};
},
computed: {
simulatorSrc() {
const dir = this.$route.path.split('/').pop();
methods: {
getSimulatorPath() {
const dir = location.pathname.split('/').pop();
if (dir === 'quickstart' || dir === 'changelog') {
return '/zanui/vue/examples';
} else {