refactor(frontend): Reactivityで型を明示するように (#12791)
* refactor(frontend): Reactivityで型を明示するように * fix: プロパティの参照が誤っているのを修正 * fix: 初期化の値を空配列に書き換えていた部分をnullに置き換え
This commit is contained in:
@@ -29,7 +29,7 @@ import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
|
||||
const storedAccounts = ref<any>(null);
|
||||
const storedAccounts = ref<{ id: string, token: string }[] | null>(null);
|
||||
const accounts = ref<Misskey.entities.UserDetailed[]>([]);
|
||||
|
||||
const init = async () => {
|
||||
|
@@ -54,7 +54,7 @@ import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
|
||||
const list = ref<any>(null);
|
||||
const list = ref<InstanceType<typeof FormPagination>>();
|
||||
|
||||
const pagination = {
|
||||
endpoint: 'i/apps' as const,
|
||||
|
@@ -58,6 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import FormLink from '@/components/form/link.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
@@ -73,9 +74,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i } from '@/account.js';
|
||||
|
||||
const fetching = ref(true);
|
||||
const usage = ref<any>(null);
|
||||
const capacity = ref<any>(null);
|
||||
const uploadFolder = ref<any>(null);
|
||||
const usage = ref<number | null>(null);
|
||||
const capacity = ref<number | null>(null);
|
||||
const uploadFolder = ref<Misskey.entities.DriveFolder | null>(null);
|
||||
const alwaysMarkNsfw = ref($i.alwaysMarkNsfw);
|
||||
const autoSensitive = ref($i.autoSensitive);
|
||||
|
||||
|
@@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onActivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
|
||||
import { ComputedRef, Ref, computed, onActivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
||||
@@ -36,7 +36,7 @@ import { signout, $i } from '@/account.js';
|
||||
import { clearCache } from '@/scripts/clear-cache.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
||||
import { PageMetadata, definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
||||
import * as os from '@/os.js';
|
||||
|
||||
const indexInfo = {
|
||||
@@ -46,7 +46,7 @@ const indexInfo = {
|
||||
};
|
||||
const INFO = ref(indexInfo);
|
||||
const el = shallowRef<HTMLElement | null>(null);
|
||||
const childInfo = ref(null);
|
||||
const childInfo: Ref<ComputedRef<PageMetadata> | null> = ref(null);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
@@ -87,6 +87,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
@@ -99,7 +100,7 @@ import { deepClone } from '@/scripts/clone.js';
|
||||
|
||||
const props = defineProps<{
|
||||
_id: string;
|
||||
userLists: any[] | null;
|
||||
userLists: Misskey.entities.UserList[] | null;
|
||||
}>();
|
||||
|
||||
const statusbar = reactive(deepClone(defaultStore.state.statusbars.find(x => x.id === props._id)));
|
||||
|
@@ -16,6 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, computed } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import XStatusbar from './statusbar.statusbar.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
@@ -27,7 +28,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const statusbars = defaultStore.reactiveState.statusbars;
|
||||
|
||||
const userLists = ref();
|
||||
const userLists = ref<Misskey.entities.UserList[] | null>(null);
|
||||
|
||||
onMounted(() => {
|
||||
os.api('users/lists/list').then(res => {
|
||||
|
@@ -25,7 +25,7 @@ import * as os from '@/os.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const installThemeCode = ref(null);
|
||||
const installThemeCode = ref<string | null>(null);
|
||||
|
||||
async function install(code: string): Promise<void> {
|
||||
try {
|
||||
|
@@ -46,7 +46,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const installedThemes = ref(getThemes());
|
||||
const builtinThemes = getBuiltinThemesRef();
|
||||
const selectedThemeId = ref(null);
|
||||
const selectedThemeId = ref<string | null>(null);
|
||||
|
||||
const themes = computed(() => [...installedThemes.value, ...builtinThemes.value]);
|
||||
|
||||
|
Reference in New Issue
Block a user