Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Switch] 表格行内编辑 defaultValue 不生效 #4194

Open
mansai opened this issue May 15, 2024 · 2 comments
Open

[Switch] 表格行内编辑 defaultValue 不生效 #4194

mansai opened this issue May 15, 2024 · 2 comments

Comments

@mansai
Copy link

mansai commented May 15, 2024

tdesign-vue-next 版本

1.9.4

重现链接

No response

重现步骤

放在template里是有效的
<t-switch size="large" :customValue="[1, 0]" :label="['是', '否']" :defaultValue="defaultValue" ></t-switch>

放在表格里不起作用
const defaultValue=ref(1);

const columns = [
{ colKey: 'row-select', type: 'multiple', width: 50 },
{ colKey: 'serial-number', title: t('pages.common.sequence'), width: 45, },
{
colKey: 'Switch', title: '是否测试', width: 150, edit: {
component: Switch, props: { label: ['是','否'],customValue:[1,0],defaultValue:defaultValue }, showEditIcon: false,
}
},
]

image
临时解决办法,在data数据行必须先给Switch字段赋值一个值

期望结果

No response

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

👋 @mansai,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@ZWkang
Copy link
Contributor

ZWkang commented May 20, 2024

@mansai 请确保你的数据是 0或者1的数字

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants