Comments (2)
Probably, we should clarify in the Vue.js documentation for the v-on directive how inline function statements are parsed when using the $event
variable. The format $event => ...function code
might not be immediately clear to all users and could result in confusion or unintended behavior if not explained thoroughly.
from core.
keep $event but refer to an object with Event type
When we talk about custom events in Vue, we do not talk about CustomEvent
instances from the DOM. We talk about Vue events, and this is how they work.
It's expected and documented behavior, so changing it would be a breaking change anyway.
I think the docs you link to do show at the end of the section that custom events also receive $event, and that it will refer to the event's payload
![Bildschirmfoto 2024-05-14 um 19 45 51](https://private-user-images.githubusercontent.com/1444526/330540341-9f09025c-5c73-4db3-a5a5-a68dc69065d1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc2MjIwNzMsIm5iZiI6MTcxNzYyMTc3MywicGF0aCI6Ii8xNDQ0NTI2LzMzMDU0MDM0MS05ZjA5MDI1Yy01YzczLTRkYjMtYTVhNS1hNjhkYzY5MDY1ZDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MDVUMjEwOTMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2Q5ODgzOTg5YjY2YjllYjI2ZThmMDZmZmU3ODk1MmFhMGEwZWU2YjE3ODQ1ZTcyZWJlYTM2NWVlN2Y5ZDI0MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.3gK9J8yYQEnFdcZTa2wVpY_EOQBibxrPff9yKYz0Nf0)
@quiteeasy If you have a suggestion on how to make it clearer though, the docs team over at the docs
repo would be happy about an issue or PR.
I'll close this as it's not a bug.
from core.
Related Issues (20)
- Hydration mismatch when using with JSX HOT 2
- Type-only `defineProps` compiles global types incorrectly
- Setting template ref function handler with v-for and inline event handler (while passing element from v-for) causes ref to recall its handler every rerender HOT 3
- Get a bug of 'Unhandled error during execution of scheduler flush. This is likely a Vue internals bug.' HOT 1
- v-bind() in CSS + Teleport doesn't work (another edge case)
- Spurious component updates when v-model is defined in parent, but not used in child. HOT 4
- hook onMounted has been called when app unmount HOT 1
- Unhandled error during execution of render function HOT 6
- ref typing converts null type to unknown when strictNullChecks is false HOT 3
- v-bind 是不是有bug HOT 1
- Error with createSSRApp when Using JSX/TSX HOT 2
- Error codes in production not passed to error handlers as described HOT 4
- New slot syntax doesn't work the same way as old syntax HOT 1
- Many issues with Transition since 3.4.26 HOT 1
- 生产版本用户无法打印自己的值 HOT 1
- Type error when using generic with withDefaults HOT 1
- Transition does not work when the component has an annotation at the same level as the root node HOT 1
- CDN import: Component single tag `<Comp.. />` parsing exception, DOM lost. HOT 3
- v-for does not infer actual key/value types of generic prop HOT 2
- `defineAsyncComponent` breaks library umd/iife build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.