mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	fix(frontend/AiScript): Ui:C:selectの値が切り替わらない問題を修正 (#15184)
* fix(frontend/AiScript): Ui:C:selectの値が切り替わらない問題を修正 * Update Changelog
This commit is contained in:
		
							parent
							
								
									79b3d2a711
								
							
						
					
					
						commit
						f4e025170e
					
				
					 2 changed files with 15 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -13,6 +13,7 @@
 | 
			
		|||
- Fix: 公開範囲がホームのノートの埋め込みウィジェットが読み込まれない問題を修正  
 | 
			
		||||
  (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/803)
 | 
			
		||||
- Fix: 絵文字管理画面で一部の絵文字が表示されない問題を修正
 | 
			
		||||
- Fix: `Ui:C:select`で値の変更が画面に反映されない問題を修正
 | 
			
		||||
 | 
			
		||||
### Server
 | 
			
		||||
- Fix: ユーザーのプロフィール画面をアドレス入力などで直接表示した際に概要タブの描画に失敗する問題の修正( #15032 )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
		<template v-if="c.label" #label>{{ c.label }}</template>
 | 
			
		||||
		<template v-if="c.caption" #caption>{{ c.caption }}</template>
 | 
			
		||||
	</MkInput>
 | 
			
		||||
	<MkSelect v-else-if="c.type === 'select'" :small="size === 'small'" :modelValue="c.default ?? null" @update:modelValue="c.onChange">
 | 
			
		||||
	<MkSelect v-else-if="c.type === 'select'" :small="size === 'small'" :modelValue="valueForSelect" @update:modelValue="onSelectUpdate">
 | 
			
		||||
		<template v-if="c.label" #label>{{ c.label }}</template>
 | 
			
		||||
		<template v-if="c.caption" #caption>{{ c.caption }}</template>
 | 
			
		||||
		<option v-for="item in c.items" :key="item.value" :value="item.value">{{ item.text }}</option>
 | 
			
		||||
| 
						 | 
				
			
			@ -77,8 +77,8 @@ import MkPostForm from '@/components/MkPostForm.vue';
 | 
			
		|||
const props = withDefaults(defineProps<{
 | 
			
		||||
	component: AsUiComponent;
 | 
			
		||||
	components: Ref<AsUiComponent>[];
 | 
			
		||||
	size: 'small' | 'medium' | 'large';
 | 
			
		||||
	align: 'left' | 'center' | 'right';
 | 
			
		||||
	size?: 'small' | 'medium' | 'large';
 | 
			
		||||
	align?: 'left' | 'center' | 'right';
 | 
			
		||||
}>(), {
 | 
			
		||||
	size: 'medium',
 | 
			
		||||
	align: 'left',
 | 
			
		||||
| 
						 | 
				
			
			@ -86,7 +86,7 @@ const props = withDefaults(defineProps<{
 | 
			
		|||
 | 
			
		||||
const c = props.component;
 | 
			
		||||
 | 
			
		||||
function g(id) {
 | 
			
		||||
function g(id: string) {
 | 
			
		||||
	const v = props.components.find(x => x.value.id === id)?.value;
 | 
			
		||||
	if (v) return v;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -122,13 +122,22 @@ const containerStyle = computed(() => {
 | 
			
		|||
 | 
			
		||||
const valueForSwitch = ref('default' in c && typeof c.default === 'boolean' ? c.default : false);
 | 
			
		||||
 | 
			
		||||
function onSwitchUpdate(v) {
 | 
			
		||||
function onSwitchUpdate(v: boolean) {
 | 
			
		||||
	valueForSwitch.value = v;
 | 
			
		||||
	if ('onChange' in c && c.onChange) {
 | 
			
		||||
		c.onChange(v as never);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const valueForSelect = ref('default' in c && typeof c.default !== 'boolean' ? c.default ?? null : null);
 | 
			
		||||
 | 
			
		||||
function onSelectUpdate(v) {
 | 
			
		||||
	valueForSelect.value = v;
 | 
			
		||||
	if ('onChange' in c && c.onChange) {
 | 
			
		||||
		c.onChange(v as never);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function openPostForm() {
 | 
			
		||||
	const form = (c as AsUiPostFormButton).form;
 | 
			
		||||
	if (!form) return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue