Skip to content

Commit

Permalink
En docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafrok committed May 26, 2017
1 parent a400591 commit 58b5b15
Show file tree
Hide file tree
Showing 14 changed files with 625 additions and 68 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,4 @@ Vue.use(BaiduMap, {

[MIT License](https://opensource.org/licenses/MIT)

Copyright (c) 2016-present, Dafrok


Copyright (c) 2016-present, Dafrok <[email protected]>
16 changes: 13 additions & 3 deletions docs/components/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template lang="pug">
root-frame
root-frame(:lang="lang", @changeLang="changeLang")
drawer(slot="navigation")
nav
div.cate(v-for="route in routeMap")
div.cate(v-for="route in routeMap", v-if="route.name")
.mdl-list__item.title(v-text="route.name")
router-link.mdl-navigation__link.sub(v-for="subRoute in route.children", :to="`${route.path}/${subRoute.path}`", v-text="subRoute.name")
router-view(slot="page-content").doc.markdown-body
Expand All @@ -19,11 +19,21 @@ export default {
RootFrame,
Drawer
},
data () {
return {
lang: 'zh'
}
},
methods: {
changeLang (lang) {
this.lang = lang
}
},
computed: {
routeMap () {
const ret = []
for (const route of routeMap) {
if (route.meta !== 'hidden') {
if (!route.meta || (route.meta && !route.meta.hidden && route.meta.lang === this.lang)) {
ret.push(route)
}
}
Expand Down
17 changes: 14 additions & 3 deletions docs/components/RootFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ div.mdl-layout.mdl-js-layout.mdl-layout--fixed-drawer.mdl-layout--fixed-header
span.mdl-layout-title(v-text="title") VUE BAIDU MAP
.mdl-layout-spacer
.mdl-navigation
a.mdl-button.mdl-js-button.mdl-button--icon(href="https://github.com/Dafrok/vue-baidu-map")
i.material-icons.iconfont.icon-star
router-link(:to="`/${otherLang}/index`", @click="changeLang").mdl-button.mdl-js-button.mdl-button--icon
i.material-icons.iconfont.icon-zhongyingwenqiehuan-xianshizhongyingwen
a.mdl-button.mdl-js-button.mdl-button--icon(href="https://github.com/Dafrok/vue-baidu-map")
i.material-icons.iconfont.icon-github
div.mdl-layout__drawer(@click="close", ref="drawer")
router-link(to="/").logo
router-link(:to="`/${lang}/index`").logo
img(src="//dafrok.github.io/vue-baidu-map/favicon.png")
slot(name="navigation")
main.mdl-layout__content(ref="main")
Expand All @@ -36,19 +36,30 @@ div.mdl-layout.mdl-js-layout.mdl-layout--fixed-drawer.mdl-layout--fixed-header

<script>
export default {
props: ['lang'],
data () {
return {
title: this.$route.name
}
},
methods: {
changeLang () {
this.$emit('changeLang', this.otherLang)
},
close () {
document.querySelector('.mdl-layout__obfuscator').classList.remove('is-visible')
this.$refs.drawer.classList.remove('is-visible')
}
},
computed: {
otherLang () {
return this.lang === 'zh' ? 'en' : 'zh'
}
},
mounted () {
this.$router.afterEach(route => {
const meta = this.$route.meta || {}
this.$emit('changeLang', meta.lang)
this.$refs.main.scrollTop = 0
this.$nextTick(global.componentHandler.upgradeDom)
this.title = route.name
Expand Down
16 changes: 8 additions & 8 deletions docs/fonts/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1487476095020'); /* IE9*/
src: url('iconfont.eot?t=1487476095020#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff?t=1487476095020') format('woff'), /* chrome, firefox */
url('iconfont.ttf?t=1487476095020') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1487476095020#iconfont') format('svg'); /* iOS 4.1- */
src: url('iconfont.eot?t=1495788635682'); /* IE9*/
src: url('iconfont.eot?t=1495788635682#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff?t=1495788635682') format('woff'), /* chrome, firefox */
url('iconfont.ttf?t=1495788635682') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1495788635682#iconfont') format('svg'); /* iOS 4.1- */
}

.iconfont {
font-family:"iconfont" !important;
/*font-size:16px;*/
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-star:before { content: "\e611"; }
.icon-github:before { content: "\e718"; }

.icon-github:before { content: "\e735"; }
.icon-zhongyingwenqiehuan-xianshizhongyingwen:before { content: "\e620"; }

Binary file modified docs/fonts/iconfont.eot
Binary file not shown.
23 changes: 14 additions & 9 deletions docs/fonts/iconfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/fonts/iconfont.ttf
Binary file not shown.
Binary file modified docs/fonts/iconfont.woff
Binary file not shown.
21 changes: 21 additions & 0 deletions docs/md/en/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# VUE BAIDU MAP

<p align="center"><img src="//dafrok.github.io/vue-baidu-map/favicon.png" width="200px"></p>

<p align="center">Baidu Map components for Vue 2.x</p>

[![npm](https://img.shields.io/npm/v/vue-baidu-map.svg)]()
[![Travis](https://img.shields.io/travis/Dafrok/vue-baidu-map.svg)]()
[![license](https://img.shields.io/github/license/dafrok/vue-baidu-map.svg)]()
[![Package Quality](http://npm.packagequality.com/shield/vue-baidu-map.svg)](http://packagequality.com/#?package=vue-baidu-map)
[![npm](https://img.shields.io/npm/dm/vue-baidu-map.svg)]()

## Contributing

[Contributing Guide](https://github.com/Dafrok/vue-baidu-map/blob/master/CONTRIBUTING.md)

## License

[MIT License](https://opensource.org/licenses/MIT)

Copyright (c) 2016-present, Dafrok <[email protected]>
Loading

0 comments on commit 58b5b15

Please sign in to comment.