mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-21 20:25:36 +02:00
refactor(frontend): os.select, MkSelectのitem指定をオブジェクトによる定義に統一し、型を狭める (#16475)
* refactor(frontend): MkSelectのitem指定をオブジェクトによる定義に統一 * fix * spdx * fix * fix os.select * fix lint * add comment * fix * fix: os.select対応漏れを修正 * fix * fix * fix: MkSelectのmodelに対する型チェックを厳格化 * fix * fix * fix * Update packages/frontend/src/components/MkEmbedCodeGenDialog.vue Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * fix * fix types * fix * fix * Update packages/frontend/src/pages/admin/roles.editor.vue Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * fix: MkSelectに直接配列を指定している場合に正常に型が解決されるように --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -11,11 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkResult v-if="resultType === 'notFound'" type="notFound"/>
|
||||
<MkResult v-if="resultType === 'error'" type="error"/>
|
||||
<MkSelect
|
||||
v-model="resultType" :items="[
|
||||
{ label: 'empty', value: 'empty' },
|
||||
{ label: 'notFound', value: 'notFound' },
|
||||
{ label: 'error', value: 'error' },
|
||||
]"
|
||||
v-model="resultType" :items="resultTypeDef"
|
||||
></MkSelect>
|
||||
|
||||
<MkSystemIcon v-if="iconType === 'info'" type="info" style="width: 150px;"/>
|
||||
@@ -25,14 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkSystemIcon v-if="iconType === 'error'" type="error" style="width: 150px;"/>
|
||||
<MkSystemIcon v-if="iconType === 'waiting'" type="waiting" style="width: 150px;"/>
|
||||
<MkSelect
|
||||
v-model="iconType" :items="[
|
||||
{ label: 'info', value: 'info' },
|
||||
{ label: 'question', value: 'question' },
|
||||
{ label: 'success', value: 'success' },
|
||||
{ label: 'warn', value: 'warn' },
|
||||
{ label: 'error', value: 'error' },
|
||||
{ label: 'waiting', value: 'waiting' },
|
||||
]"
|
||||
v-model="iconType" :items="iconTypeDef"
|
||||
></MkSelect>
|
||||
|
||||
<div class="_buttons">
|
||||
@@ -56,10 +45,34 @@ import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import MkLink from '@/components/MkLink.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { useMkSelect } from '@/composables/use-mkselect.js';
|
||||
import * as os from '@/os.js';
|
||||
|
||||
const resultType = ref('empty');
|
||||
const iconType = ref('info');
|
||||
const {
|
||||
model: resultType,
|
||||
def: resultTypeDef,
|
||||
} = useMkSelect({
|
||||
items: [
|
||||
{ label: 'empty', value: 'empty' },
|
||||
{ label: 'notFound', value: 'notFound' },
|
||||
{ label: 'error', value: 'error' },
|
||||
],
|
||||
initialValue: 'empty',
|
||||
});
|
||||
const {
|
||||
model: iconType,
|
||||
def: iconTypeDef,
|
||||
} = useMkSelect({
|
||||
items: [
|
||||
{ label: 'info', value: 'info' },
|
||||
{ label: 'question', value: 'question' },
|
||||
{ label: 'success', value: 'success' },
|
||||
{ label: 'warn', value: 'warn' },
|
||||
{ label: 'error', value: 'error' },
|
||||
{ label: 'waiting', value: 'waiting' },
|
||||
],
|
||||
initialValue: 'info',
|
||||
});
|
||||
|
||||
definePage(() => ({
|
||||
title: 'DEBUG ROOM',
|
||||
|
||||
Reference in New Issue
Block a user