来自 naive-ui 的类型)
* @returns 渲染后的VNode
*/
const renderSingleSelectTag = ({ option }: { option: DnsProviderOption }): VNode => {
return (
{option.label ? (
renderLabel(option)
) : (
{props.type === 'dns' ? $t('t_0_1747019621052') : $t('t_0_1746858920894')}
)}
)
}
return () => (
renderSingleSelectTag({ option: option as DnsProviderOption })
}
filter={(pattern: string, option: any) => controller.handleFilter(pattern, option as DnsProviderOption)}
placeholder={props.type === 'dns' ? $t('t_3_1745490735059') : $t('t_0_1746858920894')}
value={controller.param.value.value} // 使用 controller 中的 param.value.value
onUpdateValue={controller.handleUpdateValue}
disabled={props.disabled}
v-slots={{
empty: () => {
return (
{controller.errorMessage.value ||
(props.type === 'dns' ? $t('t_1_1746858922914') : $t('t_2_1746858923964'))}
)
},
}}
/>
{props.isAddMode && (
{props.type === 'dns' ? $t('t_1_1746004861166') : $t('t_3_1746858920060')}
controller.loadDnsProviders(props.type)}
loading={controller.isLoading.value}
disabled={props.disabled}
>
{$t('t_0_1746497662220')}
)}
)
},
})