Skip to content

Commit

Permalink
chore: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Dec 14, 2018
1 parent 67877a0 commit 3397a38
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 82 deletions.
4 changes: 1 addition & 3 deletions src/components/Badge.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<template functional>
<span class="badge" :class="props.type">
<slot></slot>
</span>
<span class="badge" :class="props.type"> <slot></slot> </span>
</template>

<script>
Expand Down
12 changes: 11 additions & 1 deletion src/components/DocuteSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
<slot name="default"></slot>
</select>
<div class="arrow">
<svg width="13" height="6" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#979797" fill-rule="evenodd" stroke-linecap="square"><path d="M1.367.375l5.185 5.303M11.685.375L6.5 5.678"></path></svg>
<svg
width="13"
height="6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="#979797"
fill-rule="evenodd"
stroke-linecap="square"
>
<path d="M1.367.375l5.185 5.303M11.685.375L6.5 5.678"></path>
</svg>
</div>
</div>
</template>
Expand Down
1 change: 0 additions & 1 deletion src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default {
}
</script>


<style scoped>
@import 'vars.css';
Expand Down
6 changes: 5 additions & 1 deletion src/components/HeaderNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{{ item.title }}
<external-link-icon />
</a>
<router-link v-else :to="item.link" :class="{active: $route.path === item.link}">
<router-link
v-else
:to="item.link"
:class="{active: $route.path === item.link}"
>
{{ item.title }}
</router-link>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/MobileHeaderNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{{ item.title }}
<external-link-icon />
</a>
<router-link v-else :to="item.link" :class="{active: $route.path === item.link}">
<router-link
v-else
:to="item.link"
:class="{active: $route.path === item.link}"
>
{{ item.title }}
</router-link>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/components/PrevNextLinks.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<div class="prev-next-links" v-if="prevLinkItem || nextLinkItem">
<div class="prev-link" v-if="prevLinkItem">
<router-link
:to="prevLinkItem.link">
<router-link :to="prevLinkItem.link">
{{ prevLinkItem.title }}
</router-link>
</div>

<div class="next-link" v-if="nextLinkItem">
<router-link
:to="nextLinkItem.link">
<router-link :to="nextLinkItem.link">
{{ nextLinkItem.title }}
</router-link> →
</router-link>
</div>
</div>
</template>
Expand Down
3 changes: 1 addition & 2 deletions src/components/Root.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ export default {
}
</script>

<style src="../css/global.css">
</style>
<style src="../css/global.css"></style>
104 changes: 55 additions & 49 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,59 +1,66 @@
<template>
<div class="Sidebar" :class="{isShown: $store.state.showSidebar}">
<InjectedComponents position="sidebar:start" />

<MobileHeaderNav v-if="$store.getters.config.nav" :nav="$store.getters.config.nav" />

<div class="SidebarItems">
<InjectedComponents position="sidebar:start" />

<MobileHeaderNav
v-if="$store.getters.config.nav"
:nav="$store.getters.config.nav"
/>

<div class="SidebarItems">
<div
v-for="(item, index) in $store.getters.sidebar"
:class="['SidebarItem', item.title && 'hasTitle']"
:key="index"
>
<div class="ItemTitle" v-if="item.title">{{ item.title }}</div>
<template v-for="(link, index) of item.links">
<a
v-if="isExternalLink(link.link)"
:key="index"
:href="link.link"
class="ItemLink"
target="_blank"
>
{{ link.title }}
<external-link-icon />
</a>
<router-link
v-else
:key="index"
:to="link.link"
class="ItemLink"
:class="{active: $route.path === link.link}"
>
{{ link.title }}
</router-link>
<div
v-for="(item, index) in $store.getters.sidebar"
:class="['SidebarItem', item.title && 'hasTitle']"
:key="index">
<div class="ItemTitle" v-if="item.title">
{{ item.title }}
</div>
<template v-for="(link, index) of item.links">
<a
v-if="isExternalLink(link.link)"
:key="index"
:href="link.link"
class="ItemLink"
target="_blank">
{{ link.title }}
<external-link-icon />
</a>
<router-link
v-else
:key="index"
:to="link.link"
class="ItemLink"
:class="{active: $route.path === link.link}">
{{ link.title }}
</router-link>
<div
class="LinkToc"
v-if="!$store.state.fetchingFile &&
class="LinkToc"
v-if="
!$store.state.fetchingFile &&
link.toc !== false &&
link.link === $route.path &&
$store.state.page.headings &&
$store.state.page.headings.length > 0"
:key="`toc-${index}`">
<router-link
class="TocHeading"
:to="{hash: heading.slug}"
:data-level="heading.level"
v-for="heading in $store.state.page.headings"
:key="heading.slug"
v-html="heading.text">
</router-link>
</div>
</template>
$store.state.page.headings.length > 0
"
:key="`toc-${index}`"
>
<router-link
class="TocHeading"
:to="{hash: heading.slug}"
:data-level="heading.level"
v-for="heading in $store.state.page.headings"
:key="heading.slug"
v-html="heading.text"
>
</router-link>
</div>
</div>

<InjectedComponents position="sidebar:end" />

</template>
</div>
</div>

<InjectedComponents position="sidebar:end" />
</div>
</template>

<script>
Expand All @@ -71,7 +78,6 @@ export default {
}
</script>


<style scoped>
@import 'vars.css';
Expand Down
4 changes: 2 additions & 2 deletions src/components/SidebarMask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div
class="SidebarMask"
@click="$store.commit('TOGGLE_SIDEBAR', false)"
v-if="$store.state.showSidebar">
</div>
v-if="$store.state.showSidebar"
></div>
</template>

<style scoped>
Expand Down
5 changes: 4 additions & 1 deletion src/components/SidebarToggle.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<span class="sidebar-toggle" @click="toggleSidebar">
<svg aria-hidden="true" role="img" viewBox="0 0 448 512">
<path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path>
<path
fill="currentColor"
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"
></path>
</svg>
</span>
</template>
Expand Down
13 changes: 10 additions & 3 deletions src/components/icons/ExternalLinkIcon.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<template functional>
<svg
viewBox="0 0 32 32"
width="15" height="15"
fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round"
width="15"
height="15"
fill="none"
stroke="currentcolor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
v-bind="data.attrs" v-on="data.on" :class="[data.staticClass, data.class]">
v-bind="data.attrs"
v-on="data.on"
:class="[data.staticClass, data.class]"
>
<path d="M14 9 L3 9 3 29 23 29 23 18 M18 4 L28 4 28 14 M28 4 L14 18" />
</svg>
</template>
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/i18n/LanguageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
v-for="language in languages"
:value="language.path"
:selected="isCurrentLocale(language.path)"
:key="language.path">
:key="language.path"
>
{{ language.language }}
</option>
</DocuteSelect>
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/versions/VersionsSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
v-for="(value, key) in $store.getters.config.versions"
:key="key"
:value="value.link"
:selected="currentVersionLink === value.link">
:selected="currentVersionLink === value.link"
>
{{ key }}
</option>
</DocuteSelect>
Expand Down
16 changes: 5 additions & 11 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
class="Wrap"
:class="{
'is-center': $store.getters.centerContent
}">
}"
>
<Sidebar />
<SidebarMask />
<div
class="Main"
v-if="$store.state.fetchingFile">
<div class="Main" v-if="$store.state.fetchingFile">
<content-loader
:height="160"
:width="400"
Expand All @@ -25,9 +24,7 @@
<rect x="0" y="100" rx="3" ry="3" width="201" height="6.4" />
</content-loader>
</div>
<div
class="Main"
v-else>
<div class="Main" v-else>
<InjectedComponents position="main:start" />
<component :is="MarkdownTitle" class="page-title" />
<component :is="MarkdownBody" />
Expand Down Expand Up @@ -137,10 +134,7 @@ export default {
}
</script>

<style src="../css/prism.css">
</style>
<style src="../css/markdown.css">
</style>
<style src="../css/prism.css"></style> <style src="../css/markdown.css"></style>

<style scoped>
@import 'vars.css';
Expand Down

0 comments on commit 3397a38

Please sign in to comment.