Skip to content

Commit

Permalink
chore: lint code (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen authored and yyx990803 committed Apr 26, 2018
1 parent d454b1c commit 7bfb8a6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
5 changes: 2 additions & 3 deletions lib/default-theme/DropdownLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
</template>

<script>
import { isExternal, ensureExt } from './util'
import NavLink from './NavLink.vue'
import DropdownTransition from './DropdownTransition.vue'
export default {
components: { NavLink, DropdownTransition },
data() {
data () {
return {
open: false
}
Expand All @@ -44,7 +43,7 @@ export default {
}
},
methods: {
toggle() {
toggle () {
this.open = !this.open
}
}
Expand Down
6 changes: 2 additions & 4 deletions lib/default-theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default {
)
},
shouldShowSidebar () {
const { themeConfig } = this.$site
const { frontmatter } = this.$page
return (
!frontmatter.layout &&
Expand All @@ -73,13 +72,13 @@ export default {
this.$localePath
)
},
pageClasses() {
pageClasses () {
const userPageClass = this.$page.frontmatter.pageClass
return [
{
'no-navbar': !this.shouldShowNavbar,
'sidebar-open': this.isSidebarOpen,
'no-sidebar': !this.shouldShowSidebar,
'no-sidebar': !this.shouldShowSidebar
},
userPageClass
]
Expand All @@ -92,7 +91,6 @@ export default {
this.$ssrContext.lang = this.$lang
this.$ssrContext.description = this.$page.description || this.$description
}
},
mounted () {
Expand Down
2 changes: 1 addition & 1 deletion lib/default-theme/NavLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
}
},
computed: {
link() {
link () {
return ensureExt(this.item.link)
}
},
Expand Down
8 changes: 4 additions & 4 deletions lib/default-theme/NavLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
nav () {
const { locales } = this.$site
if (locales && Object.keys(locales).length > 1) {
let currentLink = this.$page.path
const currentLink = this.$page.path
const routes = this.$router.options.routes
const themeLocales = this.$site.themeConfig.locales || {}
const languageDropdown = {
Expand Down Expand Up @@ -63,11 +63,11 @@ export default {
return this.userNav
},
userLinks () {
return (this.nav || []).map((link => {
return (this.nav || []).map(link => {
return Object.assign(resolveNavLinkItem(link), {
items: (link.items || []).map(resolveNavLinkItem)
})
}))
})
},
repoLink () {
const { repo } = this.$site.themeConfig
Expand All @@ -93,7 +93,7 @@ export default {
}
return 'Source'
},
}
}
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions lib/default-theme/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

<script>
import SidebarGroup from './SidebarGroup.vue'
import SidebarLink, { groupHeaders } from './SidebarLink.vue'
import SidebarLink from './SidebarLink.vue'
import NavLinks from './NavLinks.vue'
import { isActive, resolveSidebarItems } from './util'
import { isActive } from './util'
export default {
components: { SidebarGroup, SidebarLink, NavLinks },
Expand Down
2 changes: 1 addition & 1 deletion lib/default-theme/SidebarLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function renderLink (h, to, text, active) {
props: {
to,
activeClass: '',
exactActiveClass: '',
exactActiveClass: ''
},
class: {
active,
Expand Down

0 comments on commit 7bfb8a6

Please sign in to comment.