fix: remove eslint and prettier warnings
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
<CBreadcrumb class="d-md-down-none me-auto mb-0">
|
||||
<CBreadcrumbItem
|
||||
v-for="item in breadcrumbs"
|
||||
:key="item"
|
||||
:href="item.active ? '' : item.path"
|
||||
:active="item.active"
|
||||
:key="item"
|
||||
>
|
||||
{{ item.name }}
|
||||
</CBreadcrumbItem>
|
||||
|
||||
@@ -55,7 +55,6 @@ export default {
|
||||
AppHeaderDropdownAccnt,
|
||||
},
|
||||
setup() {
|
||||
|
||||
return {
|
||||
logo,
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
>
|
||||
<CSidebarBrand>
|
||||
<CIcon
|
||||
customClassName="sidebar-brand-full"
|
||||
custom-class-name="sidebar-brand-full"
|
||||
:icon="logoNegative"
|
||||
:height="35"
|
||||
/>
|
||||
<CIcon
|
||||
customClassName="sidebar-brand-narrow"
|
||||
custom-class-name="sidebar-brand-narrow"
|
||||
:icon="sygnet"
|
||||
:height="35"
|
||||
/>
|
||||
|
||||
@@ -1,39 +1,45 @@
|
||||
import { defineComponent, h, onMounted, ref, resolveComponent } from 'vue'
|
||||
import { RouterLink, useRoute } from 'vue-router'
|
||||
|
||||
import { CBadge, CSidebarNav, CNavItem, CNavGroup, CNavTitle } from '@coreui/vue'
|
||||
import {
|
||||
CBadge,
|
||||
CSidebarNav,
|
||||
CNavItem,
|
||||
CNavGroup,
|
||||
CNavTitle,
|
||||
} from '@coreui/vue'
|
||||
import nav from '@/_nav.js'
|
||||
|
||||
const normalizePath = (path) =>
|
||||
decodeURI(path)
|
||||
.replace(/#.*$/, '')
|
||||
.replace(/(index)?\.(html)$/, '')
|
||||
decodeURI(path)
|
||||
.replace(/#.*$/, '')
|
||||
.replace(/(index)?\.(html)$/, '')
|
||||
|
||||
const isActiveLink = (route, link) => {
|
||||
if (link === undefined) {
|
||||
return false
|
||||
}
|
||||
if (link === undefined) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (route.hash === link) {
|
||||
return true
|
||||
}
|
||||
if (route.hash === link) {
|
||||
return true
|
||||
}
|
||||
|
||||
const currentPath = normalizePath(route.path)
|
||||
const targetPath = normalizePath(link)
|
||||
const currentPath = normalizePath(route.path)
|
||||
const targetPath = normalizePath(link)
|
||||
|
||||
return currentPath === targetPath
|
||||
return currentPath === targetPath
|
||||
}
|
||||
|
||||
const isActiveItem = (route, item) => {
|
||||
if (isActiveLink(route, item.to)) {
|
||||
return true
|
||||
}
|
||||
if (isActiveLink(route, item.to)) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (item.items) {
|
||||
return item.items.some((child) => isActiveItem(route, child))
|
||||
}
|
||||
if (item.items) {
|
||||
return item.items.some((child) => isActiveItem(route, child))
|
||||
}
|
||||
|
||||
return false
|
||||
return false
|
||||
}
|
||||
|
||||
const AppSidebarNav = defineComponent({
|
||||
@@ -56,7 +62,9 @@ const AppSidebarNav = defineComponent({
|
||||
return h(
|
||||
CNavGroup,
|
||||
{
|
||||
...firstRender.value && { visible: item.items.some((child) => isActiveItem(route, child))}
|
||||
...(firstRender.value && {
|
||||
visible: item.items.some((child) => isActiveItem(route, child)),
|
||||
}),
|
||||
},
|
||||
{
|
||||
togglerContent: () => [
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
<template>
|
||||
<CCallout color="info" class="bg-white">
|
||||
{{content
|
||||
{{
|
||||
content
|
||||
? content
|
||||
: `A Vue ${name} component ${
|
||||
plural ? 'have' : 'has'
|
||||
} been created as a native Vue.js version
|
||||
of Bootstrap ${name}. ${name} ${plural ? 'are' : 'is'} delivered with some new features,
|
||||
variants, and unique design that matches CoreUI Design System requirements.`}}
|
||||
of Bootstrap ${name}. ${name} ${
|
||||
plural ? 'are' : 'is'
|
||||
} delivered with some new features,
|
||||
variants, and unique design that matches CoreUI Design System requirements.`
|
||||
}}
|
||||
<br />
|
||||
<br />
|
||||
For more information please visit our official
|
||||
<CLink :href="href" target="_blank">
|
||||
<CLink :href="url" target="_blank">
|
||||
documentation of CoreUI Components Library for Vue.js
|
||||
</CLink>
|
||||
.
|
||||
@@ -40,10 +44,10 @@ export default {
|
||||
plural: Boolean,
|
||||
},
|
||||
setup(props) {
|
||||
const href = `https://coreui.io/vue/docs/${packageJson.config.coreui_library_short_version}/${props.href}`
|
||||
const url = `https://coreui.io/vue/docs/${packageJson.config.coreui_library_short_version}/${props.url}`
|
||||
|
||||
return {
|
||||
href,
|
||||
url,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</CNavLink>
|
||||
</CNavItem>
|
||||
<CNavItem>
|
||||
<CNavLink :href="href" target="_blank">
|
||||
<CNavLink :href="url" target="_blank">
|
||||
<CIcon icon="cil-code" class="me-2" />
|
||||
Code
|
||||
</CNavLink>
|
||||
@@ -33,10 +33,10 @@ export default {
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const href = `https://coreui.io/vue/docs/${pkg.config.coreui_library_short_version}/${props.href}`
|
||||
const url = `https://coreui.io/vue/docs/${pkg.config.coreui_library_short_version}/${props.href}`
|
||||
|
||||
return {
|
||||
href,
|
||||
url,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user