nuxt+tsx项目 class报错
原因
tsx是基于react封装的语法格式,类名使用className声明的,而不存在class;但是在vue中是不存在className的,所以是不可以用className的
解决方案:
修改react 底层jsx 属性定义
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
// React-specific Attributes
defaultChecked?: boolean;
defaultValue?: string | string[];
suppressContentEditableWarning?: boolean;
suppressHydrationWarning?: boolean;
class?: string; // 添加次class属性名即可解决此问题