提交 7bfb8a66 编写于 作者: 花裤衩 提交者: Evan You

chore: lint code (#264)

上级 d454b1cf
......@@ -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
}
......@@ -44,7 +43,7 @@ export default {
}
},
methods: {
toggle() {
toggle () {
this.open = !this.open
}
}
......
......@@ -56,7 +56,6 @@ export default {
)
},
shouldShowSidebar () {
const { themeConfig } = this.$site
const { frontmatter } = this.$page
return (
!frontmatter.layout &&
......@@ -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
]
......@@ -92,7 +91,6 @@ export default {
this.$ssrContext.lang = this.$lang
this.$ssrContext.description = this.$page.description || this.$description
}
},
mounted () {
......
......@@ -24,7 +24,7 @@ export default {
}
},
computed: {
link() {
link () {
return ensureExt(this.item.link)
}
},
......
......@@ -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 = {
......@@ -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
......@@ -93,7 +93,7 @@ export default {
}
return 'Source'
},
}
}
}
</script>
......
......@@ -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 },
......
......@@ -34,7 +34,7 @@ function renderLink (h, to, text, active) {
props: {
to,
activeClass: '',
exactActiveClass: '',
exactActiveClass: ''
},
class: {
active,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册