chore(editor): 解决warning

This commit is contained in:
roymondchen 2024-03-19 19:18:03 +08:00
parent 96149bd2ae
commit b3cf919273
7 changed files with 6 additions and 10 deletions

View File

@ -252,7 +252,7 @@ const closedHandler = () => {
changedValue.value = undefined; changedValue.value = undefined;
}; };
const parentFloating = inject<Ref<HTMLDivElement>>('parentFloating'); const parentFloating = inject<Ref<HTMLDivElement | null>>('parentFloating', ref(null));
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating); const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
defineExpose({ defineExpose({

View File

@ -318,6 +318,6 @@ const addDialogVisible = defineModel<boolean>('visible', { default: false });
const addFromJsonDialogVisible = defineModel<boolean>('visible1', { default: false }); const addFromJsonDialogVisible = defineModel<boolean>('visible1', { default: false });
const { height: editorHeight } = useEditorContentHeight(); const { height: editorHeight } = useEditorContentHeight();
const parentFloating = inject<Ref<HTMLDivElement>>('parentFloating'); const parentFloating = inject<Ref<HTMLDivElement | null>>('parentFloating', ref(null));
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating); const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
</script> </script>

View File

@ -250,6 +250,6 @@ const toggleValue = (row: MockSchema, key: 'enable' | 'useInEditor', value: bool
const addDialogVisible = defineModel<boolean>('visible', { default: false }); const addDialogVisible = defineModel<boolean>('visible', { default: false });
const { height: editorHeight } = useEditorContentHeight(); const { height: editorHeight } = useEditorContentHeight();
const parentFloating = inject<Ref<HTMLDivElement>>('parentFloating'); const parentFloating = inject<Ref<HTMLDivElement | null>>('parentFloating', ref(null));
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating); const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
</script> </script>

View File

@ -2,7 +2,7 @@ import { Ref, ref } from 'vue';
import { UiService } from '@editor/services/ui'; import { UiService } from '@editor/services/ui';
export const useNextFloatBoxPosition = (uiService?: UiService, parent?: Ref<HTMLDivElement>) => { export const useNextFloatBoxPosition = (uiService?: UiService, parent?: Ref<HTMLDivElement | null>) => {
const boxPosition = ref({ const boxPosition = ref({
left: 0, left: 0,
top: 0, top: 0,

View File

@ -111,8 +111,8 @@
:key="config.$key ?? index" :key="config.$key ?? index"
v-if="floatBoxStates[config.$key]?.status" v-if="floatBoxStates[config.$key]?.status"
v-model:visible="floatBoxStates[config.$key].status" v-model:visible="floatBoxStates[config.$key].status"
v-model:width="columnLeftWidth"
v-model:height="columnLeftHeight" v-model:height="columnLeftHeight"
:width="columnLeftWidth"
:title="config.text" :title="config.text"
:position="{ :position="{
left: floatBoxStates[config.$key].left, left: floatBoxStates[config.$key].left,

View File

@ -55,13 +55,12 @@ const dataSourceConfig = ref<FormConfig>([]);
const { height: editorHeight } = useEditorContentHeight(); const { height: editorHeight } = useEditorContentHeight();
const parentFloating = inject<Ref<HTMLDivElement>>('parentFloating'); const parentFloating = inject<Ref<HTMLDivElement | null>>('parentFloating', ref(null));
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating); const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
watchEffect(() => { watchEffect(() => {
initValues.value = props.values; initValues.value = props.values;
dataSourceConfig.value = services?.dataSourceService.getFormConfig(initValues.value.type) || []; dataSourceConfig.value = services?.dataSourceService.getFormConfig(initValues.value.type) || [];
console.log(dataSourceConfig.value);
}); });
const submitHandler = (values: any) => { const submitHandler = (values: any) => {

View File

@ -68,9 +68,6 @@
} }
.m-editor-slide-list-box { .m-editor-slide-list-box {
display: flex;
min-width: 240px;
min-height: 500px;
> div { > div {
&:first-child { &:first-child {
min-width: 240px; min-width: 240px;