|
|
|
@ -9,13 +9,14 @@ const props = defineProps({
|
|
|
|
modelValue: propTypes.bool.def(false),
|
|
|
|
modelValue: propTypes.bool.def(false),
|
|
|
|
title: propTypes.string.def('Dialog'),
|
|
|
|
title: propTypes.string.def('Dialog'),
|
|
|
|
fullscreen: propTypes.bool.def(true),
|
|
|
|
fullscreen: propTypes.bool.def(true),
|
|
|
|
|
|
|
|
initialFullscreen: propTypes.bool.def(false),
|
|
|
|
width: propTypes.oneOfType([String, Number]).def('40%'),
|
|
|
|
width: propTypes.oneOfType([String, Number]).def('40%'),
|
|
|
|
scroll: propTypes.bool.def(false), // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度
|
|
|
|
scroll: propTypes.bool.def(false),
|
|
|
|
maxHeight: propTypes.oneOfType([String, Number]).def('400px')
|
|
|
|
maxHeight: propTypes.oneOfType([String, Number]).def('400px')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const getBindValue = computed(() => {
|
|
|
|
const getBindValue = computed(() => {
|
|
|
|
const delArr: string[] = ['fullscreen', 'title', 'maxHeight', 'appendToBody']
|
|
|
|
const delArr: string[] = ['fullscreen', 'initialFullscreen', 'title', 'maxHeight', 'appendToBody']
|
|
|
|
const attrs = useAttrs()
|
|
|
|
const attrs = useAttrs()
|
|
|
|
const obj = { ...attrs, ...props }
|
|
|
|
const obj = { ...attrs, ...props }
|
|
|
|
for (const key in obj) {
|
|
|
|
for (const key in obj) {
|
|
|
|
@ -26,7 +27,7 @@ const getBindValue = computed(() => {
|
|
|
|
return obj
|
|
|
|
return obj
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const isFullscreen = ref(false)
|
|
|
|
const isFullscreen = ref(props.initialFullscreen)
|
|
|
|
|
|
|
|
|
|
|
|
const toggleFull = () => {
|
|
|
|
const toggleFull = () => {
|
|
|
|
isFullscreen.value = !unref(isFullscreen)
|
|
|
|
isFullscreen.value = !unref(isFullscreen)
|
|
|
|
|