refactor: sidebar
- feat: vue-perfect-scrollbar - fix: hideMobile with toggle `sidebar-show` (deprecate `sidebar-mobile-show`) - update" dependencies
This commit is contained in:
Generated
+1617
-1916
File diff suppressed because it is too large
Load Diff
+4
-2
@@ -17,15 +17,17 @@
|
|||||||
"build": "node build/build.js"
|
"build": "node build/build.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "next",
|
"@coreui/coreui": "^2.0.0-beta.4",
|
||||||
"bootstrap": "^4.0.0",
|
"bootstrap": "^4.0.0",
|
||||||
"bootstrap-vue": "^2.0.0-rc.6",
|
"bootstrap-vue": "^2.0.0-rc.6",
|
||||||
"chart.js": "^2.7.2",
|
"chart.js": "^2.7.2",
|
||||||
"flag-icon-css": "^3.0.0",
|
"flag-icon-css": "^3.0.0",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
|
"perfect-scrollbar": "^1.3.0",
|
||||||
"simple-line-icons": "^2.4.1",
|
"simple-line-icons": "^2.4.1",
|
||||||
"vue": "2.5.16",
|
"vue": "2.5.16",
|
||||||
"vue-chartjs": "^3.3.1",
|
"vue-chartjs": "^3.3.1",
|
||||||
|
"vue-perfect-scrollbar": "^0.1.0",
|
||||||
"vue-router": "^3.0.1"
|
"vue-router": "^3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
"babel-eslint": "^8.2.2",
|
"babel-eslint": "^8.2.2",
|
||||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||||
"babel-loader": "^7.1.4",
|
"babel-loader": "^7.1.4",
|
||||||
"babel-plugin-istanbul": "^4.1.5",
|
"babel-plugin-istanbul": "^4.1.6",
|
||||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||||
"babel-plugin-transform-runtime": "^6.23.0",
|
"babel-plugin-transform-runtime": "^6.23.0",
|
||||||
"babel-plugin-transform-vue-jsx": "^3.7.0",
|
"babel-plugin-transform-vue-jsx": "^3.7.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<nav class="sidebar-nav">
|
<nav class="sidebar-nav">
|
||||||
<div slot="header"></div>
|
<VuePerfectScrollbar class="scroll-area" :settings="psSettings" @ps-scroll-y="scrollHandle">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<template v-for="(item, index) in navItems">
|
<template v-for="(item, index) in navItems">
|
||||||
<template v-if="item.title">
|
<template v-if="item.title">
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
</VuePerfectScrollbar>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,6 +53,8 @@ import SidebarNavLink from './SidebarNavLink'
|
|||||||
import SidebarNavTitle from './SidebarNavTitle'
|
import SidebarNavTitle from './SidebarNavTitle'
|
||||||
import SidebarNavItem from './SidebarNavItem'
|
import SidebarNavItem from './SidebarNavItem'
|
||||||
import SidebarNavLabel from './SidebarNavLabel'
|
import SidebarNavLabel from './SidebarNavLabel'
|
||||||
|
import VuePerfectScrollbar from 'vue-perfect-scrollbar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SidebarNav',
|
name: 'SidebarNav',
|
||||||
props: {
|
props: {
|
||||||
@@ -67,13 +70,28 @@ export default {
|
|||||||
SidebarNavLink,
|
SidebarNavLink,
|
||||||
SidebarNavTitle,
|
SidebarNavTitle,
|
||||||
SidebarNavItem,
|
SidebarNavItem,
|
||||||
SidebarNavLabel
|
SidebarNavLabel,
|
||||||
|
VuePerfectScrollbar
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
psSettings: {
|
||||||
|
maxScrollbarLength: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
scrollHandle (evt) {
|
||||||
|
// console.log(evt)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="css">
|
<style scoped lang="css">
|
||||||
.nav-link {
|
.scroll-area {
|
||||||
cursor:pointer;
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -39,3 +39,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="css">
|
||||||
|
.nav-link {
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hideMobile () {
|
hideMobile () {
|
||||||
if (document.body.classList.contains('sidebar-mobile-show')) {
|
if (document.body.classList.contains('sidebar-show')) {
|
||||||
document.body.classList.toggle('sidebar-mobile-show')
|
document.body.classList.toggle('sidebar-show')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user