refactor
This commit is contained in:
		| @@ -12,7 +12,7 @@ | ||||
|  | ||||
| <script lang="ts" setup> | ||||
| import { onUnmounted, ref, watch } from 'vue'; | ||||
| import { useWidgetPropsManager, Widget, WidgetComponentExpose } from './widget'; | ||||
| import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget'; | ||||
| import { GetFormResultType } from '@/scripts/form'; | ||||
|  | ||||
| const name = 'unixClock'; | ||||
| @@ -39,11 +39,8 @@ const widgetPropsDef = { | ||||
|  | ||||
| type WidgetProps = GetFormResultType<typeof widgetPropsDef>; | ||||
|  | ||||
| // 現時点ではvueの制限によりimportしたtypeをジェネリックに渡せない | ||||
| //const props = defineProps<WidgetComponentProps<WidgetProps>>(); | ||||
| //const emit = defineEmits<WidgetComponentEmits<WidgetProps>>(); | ||||
| const props = defineProps<{ widget?: Widget<WidgetProps>; }>(); | ||||
| const emit = defineEmits<{ (ev: 'updateProps', props: WidgetProps); }>(); | ||||
| const props = defineProps<WidgetComponentProps<WidgetProps>>(); | ||||
| const emit = defineEmits<WidgetComponentEmits<WidgetProps>>(); | ||||
|  | ||||
| const { widgetProps, configure } = useWidgetPropsManager(name, | ||||
| 	widgetPropsDef, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo