ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.1k stars 14.64k forks source link

Better TSX support #13994

Open Kingwl opened 5 years ago

Kingwl commented 5 years ago

Existing Component

Component Name

tsx

Description

The type definition of element is nearly not working now 🤷🏻‍♂️

https://github.com/wonderful-panda/vue-tsx-support

element-bot commented 5 years ago

Translation of this issue:

Existing Component no

Component Name TSX

Description The type definition of element is nearly not working now

Https://github.com/wonderful-panda/vue-tsx-support

Kingwl commented 5 years ago

ping:// @island205

island205 commented 5 years ago

more explanation?

Kingwl commented 5 years ago

This is a solution for adapting type checking in vue tsx.
That is useful(necessary) to a tsx user 🌚

duxinxiao commented 5 years ago

We use tsx too ( use the same library with Kingwl ), I should wrap the components with tsx.ofType api ( provided by library above ). Unfortunately I found there are a lot of wrong interfaces in element's types. ElRow for example, gutter is optional but there is no '?' in the type file

djkloop commented 5 years ago

@duxinxiao 能方便看下你们写的例子吗....我在项目里面使用的时候找不到name image

maskletter commented 4 years ago

你好,虽然问题已经很久了,可能你也用不上了,我还是说下吧,我是重新创建了对element-ui的声明文件,如

class Badge extends Vue {
  constructor(props: {  [index in keyof ElBadge]?: ElBadge[index]; }&{ children?: VNode|string })
}

此种方式来对element-ui进行tsx下属性的效验,理论上可以支持任意版本

我整合了一个对element-ui的全部组件的属性声明文件,放到了https://github.com/maskletter/tenp-tsxvue/blob/master/element-ui/index.d.ts

可以直接下载此文件,放在src目录下即可

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.