omi
omi copied to clipboard
使用tag注册组件不警告类型警告或者错误
如题
t-button并不会报任务类型的检测或者错误,TButton却正常报错了,显示并未传参
请问这种情况要咋处理?
t-button代码
export interface ButtonProps {
msg: string;
}
@tag("t-button")
export default class TButton extends Component<ButtonProps> {
static props = {
msg: {
type: String,
changed() {
(this as any).updateData();
},
},
};
render(props: ButtonProps) {
const { msg } = props;
return (
<button style="border: solid;">
hallo,{msg},<slot></slot>
</button>
);
}
}