How do I add attributes to existing HTML elements in TypeScript/JSX?

前端 未结 4 2162
栀梦
栀梦 2020-12-15 17:46

Anyone know how to properly add/extend all native HTML element attributes with custom ones?

With the TypeScript documentation for merging interfaces, I thought that

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 18:16

    For vue, the following works:

    declare module 'vue-tsx-support/types/dom' {
        interface InputHTMLAttributes  {
            autocorrect: string;
            autocapitalize
        }
    }
    

提交回复
热议问题