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

chore: lint code (#264)

上级 d454b1cf
...@@ -27,13 +27,12 @@ ...@@ -27,13 +27,12 @@
</template> </template>
<script> <script>
import { isExternal, ensureExt } from './util'
import NavLink from './NavLink.vue' import NavLink from './NavLink.vue'
import DropdownTransition from './DropdownTransition.vue' import DropdownTransition from './DropdownTransition.vue'
export default { export default {
components: { NavLink, DropdownTransition }, components: { NavLink, DropdownTransition },
data() { data () {
return { return {
open: false open: false
} }
...@@ -44,7 +43,7 @@ export default { ...@@ -44,7 +43,7 @@ export default {
} }
}, },
methods: { methods: {
toggle() { toggle () {
this.open = !this.open this.open = !this.open
} }
} }
......
...@@ -56,7 +56,6 @@ export default { ...@@ -56,7 +56,6 @@ export default {
) )
}, },
shouldShowSidebar () { shouldShowSidebar () {
const { themeConfig } = this.$site
const { frontmatter } = this.$page const { frontmatter } = this.$page
return ( return (
!frontmatter.layout && !frontmatter.layout &&
...@@ -73,13 +72,13 @@ export default { ...@@ -73,13 +72,13 @@ export default {
this.$localePath this.$localePath
) )
}, },
pageClasses() { pageClasses () {
const userPageClass = this.$page.frontmatter.pageClass const userPageClass = this.$page.frontmatter.pageClass
return [ return [
{ {
'no-navbar': !this.shouldShowNavbar, 'no-navbar': !this.shouldShowNavbar,
'sidebar-open': this.isSidebarOpen, 'sidebar-open': this.isSidebarOpen,
'no-sidebar': !this.shouldShowSidebar, 'no-sidebar': !this.shouldShowSidebar
}, },
userPageClass userPageClass
] ]
...@@ -92,7 +91,6 @@ export default { ...@@ -92,7 +91,6 @@ export default {
this.$ssrContext.lang = this.$lang this.$ssrContext.lang = this.$lang
this.$ssrContext.description = this.$page.description || this.$description this.$ssrContext.description = this.$page.description || this.$description
} }
}, },
mounted () { mounted () {
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
} }
}, },
computed: { computed: {
link() { link () {
return ensureExt(this.item.link) return ensureExt(this.item.link)
} }
}, },
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
nav () { nav () {
const { locales } = this.$site const { locales } = this.$site
if (locales && Object.keys(locales).length > 1) { if (locales && Object.keys(locales).length > 1) {
let currentLink = this.$page.path const currentLink = this.$page.path
const routes = this.$router.options.routes const routes = this.$router.options.routes
const themeLocales = this.$site.themeConfig.locales || {} const themeLocales = this.$site.themeConfig.locales || {}
const languageDropdown = { const languageDropdown = {
...@@ -63,11 +63,11 @@ export default { ...@@ -63,11 +63,11 @@ export default {
return this.userNav return this.userNav
}, },
userLinks () { userLinks () {
return (this.nav || []).map((link => { return (this.nav || []).map(link => {
return Object.assign(resolveNavLinkItem(link), { return Object.assign(resolveNavLinkItem(link), {
items: (link.items || []).map(resolveNavLinkItem) items: (link.items || []).map(resolveNavLinkItem)
}) })
})) })
}, },
repoLink () { repoLink () {
const { repo } = this.$site.themeConfig const { repo } = this.$site.themeConfig
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
} }
return 'Source' return 'Source'
}, }
} }
} }
</script> </script>
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
<script> <script>
import SidebarGroup from './SidebarGroup.vue' import SidebarGroup from './SidebarGroup.vue'
import SidebarLink, { groupHeaders } from './SidebarLink.vue' import SidebarLink from './SidebarLink.vue'
import NavLinks from './NavLinks.vue' import NavLinks from './NavLinks.vue'
import { isActive, resolveSidebarItems } from './util' import { isActive } from './util'
export default { export default {
components: { SidebarGroup, SidebarLink, NavLinks }, components: { SidebarGroup, SidebarLink, NavLinks },
......
...@@ -34,7 +34,7 @@ function renderLink (h, to, text, active) { ...@@ -34,7 +34,7 @@ function renderLink (h, to, text, active) {
props: { props: {
to, to,
activeClass: '', activeClass: '',
exactActiveClass: '', exactActiveClass: ''
}, },
class: { class: {
active, active,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册