Skip to content

Commit 7bfb8a6

Browse files
PanJiaChenyyx990803
authored andcommitted
chore: lint code (#264)
1 parent d454b1c commit 7bfb8a6

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

lib/default-theme/DropdownLink.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@
2727
</template>
2828

2929
<script>
30-
import { isExternal, ensureExt } from './util'
3130
import NavLink from './NavLink.vue'
3231
import DropdownTransition from './DropdownTransition.vue'
3332
3433
export default {
3534
components: { NavLink, DropdownTransition },
36-
data() {
35+
data () {
3736
return {
3837
open: false
3938
}
@@ -44,7 +43,7 @@ export default {
4443
}
4544
},
4645
methods: {
47-
toggle() {
46+
toggle () {
4847
this.open = !this.open
4948
}
5049
}

lib/default-theme/Layout.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export default {
5656
)
5757
},
5858
shouldShowSidebar () {
59-
const { themeConfig } = this.$site
6059
const { frontmatter } = this.$page
6160
return (
6261
!frontmatter.layout &&
@@ -73,13 +72,13 @@ export default {
7372
this.$localePath
7473
)
7574
},
76-
pageClasses() {
75+
pageClasses () {
7776
const userPageClass = this.$page.frontmatter.pageClass
7877
return [
7978
{
8079
'no-navbar': !this.shouldShowNavbar,
8180
'sidebar-open': this.isSidebarOpen,
82-
'no-sidebar': !this.shouldShowSidebar,
81+
'no-sidebar': !this.shouldShowSidebar
8382
},
8483
userPageClass
8584
]
@@ -92,7 +91,6 @@ export default {
9291
this.$ssrContext.lang = this.$lang
9392
this.$ssrContext.description = this.$page.description || this.$description
9493
}
95-
9694
},
9795
9896
mounted () {

lib/default-theme/NavLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default {
2424
}
2525
},
2626
computed: {
27-
link() {
27+
link () {
2828
return ensureExt(this.item.link)
2929
}
3030
},

lib/default-theme/NavLinks.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
nav () {
3636
const { locales } = this.$site
3737
if (locales && Object.keys(locales).length > 1) {
38-
let currentLink = this.$page.path
38+
const currentLink = this.$page.path
3939
const routes = this.$router.options.routes
4040
const themeLocales = this.$site.themeConfig.locales || {}
4141
const languageDropdown = {
@@ -63,11 +63,11 @@ export default {
6363
return this.userNav
6464
},
6565
userLinks () {
66-
return (this.nav || []).map((link => {
66+
return (this.nav || []).map(link => {
6767
return Object.assign(resolveNavLinkItem(link), {
6868
items: (link.items || []).map(resolveNavLinkItem)
6969
})
70-
}))
70+
})
7171
},
7272
repoLink () {
7373
const { repo } = this.$site.themeConfig
@@ -93,7 +93,7 @@ export default {
9393
}
9494
9595
return 'Source'
96-
},
96+
}
9797
}
9898
}
9999
</script>

lib/default-theme/Sidebar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
<script>
2121
import SidebarGroup from './SidebarGroup.vue'
22-
import SidebarLink, { groupHeaders } from './SidebarLink.vue'
22+
import SidebarLink from './SidebarLink.vue'
2323
import NavLinks from './NavLinks.vue'
24-
import { isActive, resolveSidebarItems } from './util'
24+
import { isActive } from './util'
2525
2626
export default {
2727
components: { SidebarGroup, SidebarLink, NavLinks },

lib/default-theme/SidebarLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function renderLink (h, to, text, active) {
3434
props: {
3535
to,
3636
activeClass: '',
37-
exactActiveClass: '',
37+
exactActiveClass: ''
3838
},
3939
class: {
4040
active,

0 commit comments

Comments
 (0)