Comments (5)
Hi @NataliaTepluhina, please tell us why this is not a recommended practice. This approach is beneficial in many situations. Are you guys planning to remove it in breaking changes?
from docs.
As mentioned in the PR, we didn't document this feature in both Vue 2 and Vue 3 because it's not a recommended practice to listen to @vue:
events on child components.
from docs.
I guess the reason is that it tightly couples child to parent and therefore reducing re-usability.
It is also obsfucating logical flow of the code - because why wouldn't you handle component's lifecycle hook inside the component itself?
If someone uses it internally, that answers the question of why.
Why is it a thing anyway?
Also passing functions as prop is considered bad practice. But we have no other choice.
from docs.
Similar issues;
vuejs/core#9298
vuejs/language-tools#4154
It looks like this has been requested and voiced by other people. Just tagging to get this issue moving: @yyx990803
from docs.
I guess the reason is that it tightly couples child to parent and therefore reducing re-usability.
It is also obsfucating logical flow of the code - because why wouldn't you handle component's lifecycle hook inside the component itself?
from docs.
Related Issues (20)
- 官方文档对“使用 JavaScript 表达式”部分的内容表达有歧义 HOT 1
- Props declaration intro example uses non-recommended style HOT 3
- v-if错误 HOT 1
- playground mismatch with docs example
- could u please provide a sitemap? HOT 2
- 中文网站很多地方都有问题,不能使用了。Many parts of the Chinese website have problems and cannot be used anymore HOT 16
- `inheritAttrs` should be supplemented with more See also HOT 1
- The Chinese document seems to have lost the compiled product HOT 3
- Vue3 official website cannot be opened in Chinese ,vue3官网中文打不开 HOT 4
- 中文的官网都挂了多久了,没人维护吗? HOT 3
- https://cn.vuejs.org/ 打开样式错乱 HOT 6
- Missing search result for vModelText HOT 1
- 中文网css 没有 HOT 1
- Remove deprecated Russian translation HOT 1
- Found a dead link HOT 5
- Vue's Chinese document option based API and combination based API buttons cannot be clicked on Google Chrome
- There is an issue with the Vue Chinese official website's Mac option and combination switch buttons HOT 2
- What is problem whth chinese document ? HOT 1
- In https://vuejs.org/tutorial, the error message prompts a problem with the message style HOT 4
- Missing search result for index.vue 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 docs.