vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 403 forks source link

feat(language-core): auto infer `$event.currentTarget` type #4870

Closed KazariEX closed 4 weeks ago

KazariEX commented 2 months ago

I think this is not a very good implementation, it would be great if we could introduce EventHandler similar to Solid in core.

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

vue-component-meta

``` pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-meta@4870 ```

vue-component-type-helpers

``` pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-type-helpers@4870 ```

@vue/language-core

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-core@4870 ```

@vue/language-plugin-pug

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-plugin-pug@4870 ```

@vue/language-server

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-server@4870 ```

@vue/language-service

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-service@4870 ```

vue-tsc

``` pnpm add https://pkg.pr.new/vuejs/language-tools/vue-tsc@4870 ```

@vue/typescript-plugin

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/typescript-plugin@4870 ```

commit: 9fdd538

johnsoncodehk commented 4 weeks ago

I think it should be implemented by enhancing the Vue dom type definitions (at https://github.com/vuejs/core/blob/ed01d9257104cf59d8330d96af77941b40494aa1/packages/runtime-dom/src/jsx.ts#L1316)