diff options
| author | zyoshoka <107108195+zyoshoka@users.noreply.github.com> | 2023-12-07 14:42:09 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-07 14:42:09 +0900 |
| commit | 406b4bdbe79b5b0b68fcdcb3c4b6e419460a0258 (patch) | |
| tree | a1af1cc6102d2db40a687bc848c07cce35bd414f /packages/frontend/src/pages/registry.value.vue | |
| parent | feat: Roleに関するSchemaを追加 (#12572) (diff) | |
| download | sharkey-406b4bdbe79b5b0b68fcdcb3c4b6e419460a0258.tar.gz sharkey-406b4bdbe79b5b0b68fcdcb3c4b6e419460a0258.tar.bz2 sharkey-406b4bdbe79b5b0b68fcdcb3c4b6e419460a0258.zip | |
refactor(frontend): 非推奨となったReactivity Transformを使わないように (#12539)
* refactor(frontend): 非推奨となったReactivity Transformを使わないように
* refactor: 不要な括弧を除去
* fix: 不要なアノテーションを除去
* fix: Refの配列をrefしている部分の対応
* refactor: 不要な括弧を除去
* fix: lint
* refactor: Ref、ShallowRef、ComputedRefの変数の宣言をletからconstに置換
* fix: type error
* chore: drop reactivity transform from eslint configuration
* refactor: remove unnecessary import
* fix: 対応漏れ
Diffstat (limited to 'packages/frontend/src/pages/registry.value.vue')
| -rw-r--r-- | packages/frontend/src/pages/registry.value.vue | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/packages/frontend/src/pages/registry.value.vue b/packages/frontend/src/pages/registry.value.vue index 68d6c8c1a0..29406ec83c 100644 --- a/packages/frontend/src/pages/registry.value.vue +++ b/packages/frontend/src/pages/registry.value.vue @@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts" setup> -import { watch } from 'vue'; +import { watch, computed, ref } from 'vue'; import JSON5 from 'json5'; import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; @@ -61,26 +61,26 @@ const props = defineProps<{ domain: string; }>(); -const scope = $computed(() => props.path.split('/').slice(0, -1)); -const key = $computed(() => props.path.split('/').at(-1)); +const scope = computed(() => props.path.split('/').slice(0, -1)); +const key = computed(() => props.path.split('/').at(-1)); -let value = $ref(null); -let valueForEditor = $ref(null); +const value = ref(null); +const valueForEditor = ref(null); function fetchValue() { os.api('i/registry/get-detail', { - scope, - key, + scope: scope.value, + key: key.value, domain: props.domain === '@' ? null : props.domain, }).then(res => { - value = res; - valueForEditor = JSON5.stringify(res.value, null, '\t'); + value.value = res; + valueForEditor.value = JSON5.stringify(res.value, null, '\t'); }); } async function save() { try { - JSON5.parse(valueForEditor); + JSON5.parse(valueForEditor.value); } catch (err) { os.alert({ type: 'error', @@ -94,9 +94,9 @@ async function save() { }).then(({ canceled }) => { if (canceled) return; os.apiWithDialog('i/registry/set', { - scope, - key, - value: JSON5.parse(valueForEditor), + scope: scope.value, + key: key.value, + value: JSON5.parse(valueForEditor.value), domain: props.domain === '@' ? null : props.domain, }); }); @@ -109,8 +109,8 @@ function del() { }).then(({ canceled }) => { if (canceled) return; os.apiWithDialog('i/registry/remove', { - scope, - key, + scope: scope.value, + key: key.value, domain: props.domain === '@' ? null : props.domain, }); }); @@ -118,9 +118,9 @@ function del() { watch(() => props.path, fetchValue, { immediate: true }); -const headerActions = $computed(() => []); +const headerActions = computed(() => []); -const headerTabs = $computed(() => []); +const headerTabs = computed(() => []); definePageMetadata({ title: i18n.ts.registry, |