refactor
This commit is contained in:
		
							parent
							
								
									f4bc78ad3d
								
							
						
					
					
						commit
						c310f7cef6
					
				|  | @ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { ref } from 'vue'; | ||||
| import { ref, useTemplateRef } from 'vue'; | ||||
| import MkModalWindow from '@/components/MkModalWindow.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
| import MkInput from '@/components/MkInput.vue'; | ||||
|  | @ -53,7 +53,7 @@ const emit = defineEmits<{ | |||
| 	(ev: 'closed'): void; | ||||
| }>(); | ||||
| 
 | ||||
| const dialog = ref<InstanceType<typeof MkModalWindow>>(); | ||||
| const dialog = useTemplateRef('dialog'); | ||||
| 
 | ||||
| const username = ref(''); | ||||
| const email = ref(''); | ||||
|  |  | |||
|  | @ -56,7 +56,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { computed, ref } from 'vue'; | ||||
| import { computed, ref, useTemplateRef } from 'vue'; | ||||
| import MkKeyValue from '@/components/MkKeyValue.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
| import MkInput from '@/components/MkInput.vue'; | ||||
|  | @ -81,7 +81,7 @@ const emit = defineEmits<{ | |||
| 	(ev: 'closed'): void | ||||
| }>(); | ||||
| 
 | ||||
| const windowEl = ref<InstanceType<typeof MkWindow> | null>(null); | ||||
| const windowEl = useTemplateRef('windowEl'); | ||||
| 
 | ||||
| const name = computed(() => props.emoji.name); | ||||
| const host = computed(() => props.emoji.host); | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script setup lang="ts"> | ||||
| import { computed, ref, toRefs } from 'vue'; | ||||
| import { computed, ref, toRefs, useTemplateRef } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import { i18n } from '@/i18n.js'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
|  | @ -74,7 +74,7 @@ const props = withDefaults(defineProps<{ | |||
| 
 | ||||
| const { initialRoleIds, infoMessage, title, publicOnly } = toRefs(props); | ||||
| 
 | ||||
| const windowEl = ref<InstanceType<typeof MkModalWindow>>(); | ||||
| const windowEl = useTemplateRef('windowEl'); | ||||
| const roles = ref<Misskey.entities.Role[]>([]); | ||||
| const selectedRoleIds = ref<string[]>(initialRoleIds.value ?? []); | ||||
| const fetching = ref(false); | ||||
|  |  | |||
|  | @ -50,7 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { ref } from 'vue'; | ||||
| import { ref, useTemplateRef } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import MkModalWindow from '@/components/MkModalWindow.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
|  | @ -74,7 +74,7 @@ const emit = defineEmits<{ | |||
| 	(ev: 'closed'): void | ||||
| }>(); | ||||
| 
 | ||||
| const dialog = ref<InstanceType<typeof MkModalWindow> | null>(null); | ||||
| const dialog = useTemplateRef('dialog'); | ||||
| const title = ref(props.announcement ? props.announcement.title : ''); | ||||
| const text = ref(props.announcement ? props.announcement.text : ''); | ||||
| const icon = ref(props.announcement ? props.announcement.icon : 'info'); | ||||
|  |  | |||
|  | @ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script setup lang="ts"> | ||||
| import { computed, onMounted, ref, toRefs, watch } from 'vue'; | ||||
| import { computed, onMounted, ref, toRefs, useTemplateRef, watch } from 'vue'; | ||||
| import type { DataSource, GridSetting, GridState, Size } from '@/components/grid/grid.js'; | ||||
| import type { CellAddress, CellValue, GridCell } from '@/components/grid/cell.js'; | ||||
| import type { GridContext, GridEvent } from '@/components/grid/grid-event.js'; | ||||
|  | @ -130,7 +130,7 @@ const bus = new GridEventEmitter(); | |||
|  */ | ||||
| const resizeObserver = new ResizeObserver((entries) => window.setTimeout(() => onResize(entries))); | ||||
| 
 | ||||
| const rootEl = ref<InstanceType<typeof HTMLTableElement>>(); | ||||
| const rootEl = useTemplateRef('rootEl'); | ||||
| /** | ||||
|  * グリッドの最も上位にある状態。 | ||||
|  */ | ||||
|  |  | |||
|  | @ -31,10 +31,10 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script setup lang="ts"> | ||||
| import { computed, nextTick, onMounted, onUnmounted, ref, toRefs, watch } from 'vue'; | ||||
| import { GridEventEmitter } from '@/components/grid/grid.js'; | ||||
| import { computed, nextTick, onMounted, onUnmounted, ref, toRefs, useTemplateRef, watch } from 'vue'; | ||||
| import type { Size } from '@/components/grid/grid.js'; | ||||
| import type { GridColumn } from '@/components/grid/column.js'; | ||||
| import { GridEventEmitter } from '@/components/grid/grid.js'; | ||||
| 
 | ||||
| const emit = defineEmits<{ | ||||
| 	(ev: 'operation:beginWidthChange', sender: GridColumn): void; | ||||
|  | @ -50,8 +50,8 @@ const props = defineProps<{ | |||
| 
 | ||||
| const { column, bus } = toRefs(props); | ||||
| 
 | ||||
| const rootEl = ref<InstanceType<typeof HTMLTableCellElement>>(); | ||||
| const contentEl = ref<InstanceType<typeof HTMLDivElement>>(); | ||||
| const rootEl = useTemplateRef('rootEl'); | ||||
| const contentEl = useTemplateRef('contentEl'); | ||||
| 
 | ||||
| const resizing = ref<boolean>(false); | ||||
| 
 | ||||
|  |  | |||
|  | @ -44,7 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { ref, computed } from 'vue'; | ||||
| import { ref, computed, useTemplateRef } from 'vue'; | ||||
| import MkPagination from '@/components/MkPagination.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
| import MkInfo from '@/components/MkInfo.vue'; | ||||
|  | @ -71,7 +71,7 @@ const paginationPast = { | |||
| 	}, | ||||
| }; | ||||
| 
 | ||||
| const paginationEl = ref<InstanceType<typeof MkPagination>>(); | ||||
| const paginationEl = useTemplateRef('paginationEl'); | ||||
| 
 | ||||
| const tab = ref('current'); | ||||
| 
 | ||||
|  |  | |||
|  | @ -60,7 +60,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { computed, watch, ref } from 'vue'; | ||||
| import { computed, watch, ref, useTemplateRef } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import MkWindow from '@/components/MkWindow.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
|  | @ -86,7 +86,7 @@ const emit = defineEmits<{ | |||
| 	(ev: 'closed'): void | ||||
| }>(); | ||||
| 
 | ||||
| const windowEl = ref<InstanceType<typeof MkWindow> | null>(null); | ||||
| const windowEl = useTemplateRef('windowEl'); | ||||
| const url = ref<string>(props.avatarDecoration ? props.avatarDecoration.url : ''); | ||||
| const name = ref<string>(props.avatarDecoration ? props.avatarDecoration.name : ''); | ||||
| const description = ref<string>(props.avatarDecoration ? props.avatarDecoration.description : ''); | ||||
|  |  | |||
|  | @ -79,7 +79,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { computed, watch, ref } from 'vue'; | ||||
| import { computed, watch, ref, useTemplateRef } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import MkWindow from '@/components/MkWindow.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
|  | @ -103,7 +103,7 @@ const emit = defineEmits<{ | |||
| 	(ev: 'closed'): void | ||||
| }>(); | ||||
| 
 | ||||
| const windowEl = ref<InstanceType<typeof MkWindow> | null>(null); | ||||
| const windowEl = useTemplateRef('windowEl'); | ||||
| const name = ref<string>(props.emoji ? props.emoji.name : ''); | ||||
| const category = ref<string>(props.emoji?.category ? props.emoji.category : ''); | ||||
| const aliases = ref<string>(props.emoji ? props.emoji.aliases.join(' ') : ''); | ||||
|  |  | |||
|  | @ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { computed, ref, watch } from 'vue'; | ||||
| import { computed, ref, useTemplateRef, watch } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
| import * as os from '@/os.js'; | ||||
|  | @ -80,7 +80,7 @@ const props = defineProps<{ | |||
| 	listId: string; | ||||
| }>(); | ||||
| 
 | ||||
| const paginationEl = ref<InstanceType<typeof MkPagination>>(); | ||||
| const paginationEl = useTemplateRef('paginationEl'); | ||||
| const list = ref<Misskey.entities.UserList | null>(null); | ||||
| const isPublic = ref(false); | ||||
| const name = ref(''); | ||||
|  |  | |||
|  | @ -54,7 +54,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { ref, computed } from 'vue'; | ||||
| import { ref, computed, useTemplateRef } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import FormPagination from '@/components/MkPagination.vue'; | ||||
| import { misskeyApi } from '@/utility/misskey-api.js'; | ||||
|  | @ -65,7 +65,7 @@ import MkButton from '@/components/MkButton.vue'; | |||
| import MkFolder from '@/components/MkFolder.vue'; | ||||
| import { infoImageUrl } from '@/instance.js'; | ||||
| 
 | ||||
| const list = ref<InstanceType<typeof FormPagination>>(); | ||||
| const list = useTemplateRef('list'); | ||||
| 
 | ||||
| const pagination = { | ||||
| 	endpoint: 'i/apps' as const, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue