Fix global dialog on mobile device

close #35
This commit is contained in:
CzBiX
2020-09-01 20:11:15 +08:00
parent 1d6a33c5f4
commit 21e0378dc0
2 changed files with 10 additions and 10 deletions

View File

@@ -63,21 +63,23 @@ const BUTTONS = {
],
};
const DefaultConfig = {
dialog: {
width: '25%',
}
};
const DefaultDialogWidth = '25%'
export default {
setup() {
setup(_: any, ctx: any) {
const mutations = useMutations(['closeDialog']);
const { config: userConfig } = useState(['config'], 'dialog');
const config = computed(() => {
if (!userConfig.value) {
return null;
}
return Object.assign({}, DefaultConfig, userConfig.value) as DialogConfig;
const o = Object.assign({dialog: {}}, userConfig.value) as DialogConfig;
if (!('width' in o.dialog)) {
o.dialog.width = ctx.root.$vuetify.breakpoint.smAndDown ? null : DefaultDialogWidth
}
return o
});
const value = ref<boolean>();
const input = ref<string>();

View File

@@ -41,9 +41,7 @@ export enum DialogType {
}
export interface DialogConfig {
dialog?: {
width?: string;
};
dialog?: any;
title?: string;
text: string;