Skip to content

Commit

Permalink
Add /play to debug component.
Browse files Browse the repository at this point in the history
  • Loading branch information
furybean committed Nov 12, 2016
1 parent 58dc7e1 commit 33e7e34
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@

<template>
<div id="app">
<main-header></main-header>
<main-header v-if="lang !== 'play'"></main-header>
<div class="main-cnt">
<router-view></router-view>
</div>
<main-footer></main-footer>
<main-footer v-if="lang !== 'play'"></main-footer>
</div>
</template>

Expand Down
19 changes: 19 additions & 0 deletions examples/play/component.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<div>
<el-button>Test</el-button>
</div>
</template>

<style scoped>
</style>

<script type="text/ecmascript-6">
export default {
methods: {
},
data() {
return {};
}
};
</script>
17 changes: 17 additions & 0 deletions examples/play/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<style scoped>
</style>

<template>
<div style="margin: 20px;">
<!-- Write your component in component.vue -->
<play-component></play-component>
</div>
</template>
<script>
import PlayComponent from './component.vue';
export default {
components: {
PlayComponent
}
};
</script>
8 changes: 7 additions & 1 deletion examples/route.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const registerRoute = (navConfig) => {

let route = registerRoute(navConfig);

function generateMiscRoutes(lang) {
const generateMiscRoutes = function(lang) {
let guideRoute = {
path: `/${ lang }/guide`, // 指南
redirect: `/${ lang }/guide/design`,
Expand Down Expand Up @@ -85,6 +85,12 @@ langs.forEach(lang => {
route = route.concat(generateMiscRoutes(lang.lang));
});

route.push({
path: '/play',
name: 'play',
component: require('./play/index.vue')
});

let userLanguage = localStorage.getItem('ELEMENT_LANGUAGE') || window.navigator.language;
let defaultPath = '/en-US';
if (userLanguage.indexOf('zh-') !== -1) {
Expand Down

0 comments on commit 33e7e34

Please sign in to comment.