mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
fix Bug
This commit is contained in:
@@ -52,7 +52,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, reactive, computed, ref, toRefs, toRaw, unref, provide, watch, onMounted, nextTick } from 'vue'
|
import {
|
||||||
|
defineComponent,
|
||||||
|
reactive,
|
||||||
|
computed,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
toRaw,
|
||||||
|
unref,
|
||||||
|
provide,
|
||||||
|
watch,
|
||||||
|
onMounted,
|
||||||
|
nextTick
|
||||||
|
} from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { storage } from '@/utils/Storage'
|
import { storage } from '@/utils/Storage'
|
||||||
import { TABS_ROUTES } from '@/store/mutation-types'
|
import { TABS_ROUTES } from '@/store/mutation-types'
|
||||||
@@ -322,7 +334,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function scrollNext() {
|
function scrollNext() {
|
||||||
const navWidth = navRef.value.offsetWidth
|
const navWidth = navRef.value.scrollWidth
|
||||||
const containerWidth = navScroll.value.offsetWidth
|
const containerWidth = navScroll.value.offsetWidth
|
||||||
const currentOffset = getCurrentScrollOffset()
|
const currentOffset = getCurrentScrollOffset()
|
||||||
if (navWidth - currentOffset <= containerWidth) return
|
if (navWidth - currentOffset <= containerWidth) return
|
||||||
@@ -336,9 +348,9 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateNavScroll() {
|
function updateNavScroll() {
|
||||||
if(!navRef.value)return
|
if (!navRef.value) return
|
||||||
const navWidth = (navRef.value.offsetWidth + 32)
|
let navWidth = navRef.value.scrollWidth
|
||||||
const containerWidth = navScroll.value.offsetWidth
|
let containerWidth = navScroll.value.offsetWidth
|
||||||
const currentOffset = getCurrentScrollOffset()
|
const currentOffset = getCurrentScrollOffset()
|
||||||
if (containerWidth < navWidth) {
|
if (containerWidth < navWidth) {
|
||||||
state.scrollable = true
|
state.scrollable = true
|
||||||
|
|||||||
Reference in New Issue
Block a user