|
|
@ -1,15 +1,6 @@ |
|
|
|
import classNames from '../_util/classNames'; |
|
|
|
import classNames from '../_util/classNames'; |
|
|
|
import type { PropType, ExtractPropTypes, CSSProperties } from 'vue'; |
|
|
|
import type { PropType, ExtractPropTypes, CSSProperties } from 'vue'; |
|
|
|
import { |
|
|
|
import { inject, defineComponent, ref, watch, onMounted, onBeforeUnmount, provide } from 'vue'; |
|
|
|
watchEffect, |
|
|
|
|
|
|
|
inject, |
|
|
|
|
|
|
|
defineComponent, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
watch, |
|
|
|
|
|
|
|
onMounted, |
|
|
|
|
|
|
|
onBeforeUnmount, |
|
|
|
|
|
|
|
provide, |
|
|
|
|
|
|
|
} from 'vue'; |
|
|
|
|
|
|
|
import PropTypes from '../_util/vue-types'; |
|
|
|
import PropTypes from '../_util/vue-types'; |
|
|
|
import { tuple } from '../_util/type'; |
|
|
|
import { tuple } from '../_util/type'; |
|
|
|
import initDefaultProps from '../_util/props-util/initDefaultProps'; |
|
|
|
import initDefaultProps from '../_util/props-util/initDefaultProps'; |
|
|
@ -123,25 +114,31 @@ export default defineComponent({ |
|
|
|
siderHook && siderHook.addSider(uniqueId); |
|
|
|
siderHook && siderHook.addSider(uniqueId); |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
watchEffect(() => { |
|
|
|
watch( |
|
|
|
try { |
|
|
|
() => props.breakpoint, |
|
|
|
mql?.removeEventListener('change', responsiveHandler); |
|
|
|
() => { |
|
|
|
} catch (error) { |
|
|
|
try { |
|
|
|
mql?.removeListener(responsiveHandler); |
|
|
|
mql?.removeEventListener('change', responsiveHandler); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
if (typeof window !== 'undefined') { |
|
|
|
mql?.removeListener(responsiveHandler); |
|
|
|
const { matchMedia } = window; |
|
|
|
} |
|
|
|
if (matchMedia! && props.breakpoint && props.breakpoint in dimensionMaxMap) { |
|
|
|
if (typeof window !== 'undefined') { |
|
|
|
mql = matchMedia(`(max-width: ${dimensionMaxMap[props.breakpoint]})`); |
|
|
|
const { matchMedia } = window; |
|
|
|
try { |
|
|
|
if (matchMedia! && props.breakpoint && props.breakpoint in dimensionMaxMap) { |
|
|
|
mql.addEventListener('change', responsiveHandler); |
|
|
|
mql = matchMedia(`(max-width: ${dimensionMaxMap[props.breakpoint]})`); |
|
|
|
} catch (error) { |
|
|
|
try { |
|
|
|
mql.addListener(responsiveHandler); |
|
|
|
mql.addEventListener('change', responsiveHandler); |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
mql.addListener(responsiveHandler); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
responsiveHandler(mql); |
|
|
|
} |
|
|
|
} |
|
|
|
responsiveHandler(mql); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
{ |
|
|
|
|
|
|
|
immediate: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
}); |
|
|
|
}); |
|
|
|
onBeforeUnmount(() => { |
|
|
|
onBeforeUnmount(() => { |
|
|
|
try { |
|
|
|
try { |
|
|
|