-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
hotreload hook #3227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hotreload hook #3227
Conversation
What's the use case for this? A normal component should not be concerned with how it's hot-reloaded. |
I have some complex component with many subcomponents. I need hidden textarea for input capturing. I create root component with textarea. I need clicks on any subcomponent lead to focus on this textarea. I don't want seek local root component with $parent walking and seeking for magic property. |
I think the problem is that you are placing the textarea reference in your component state. Component state should be pure serializable data. The textarea reference doesn't need to be in the state. You can just attach it to the instance in the |
|
Do not define |
I have complex app with multiple editors. I don't know exact count of components. I can bootstrap Vuejs as separate app, but it breaks idea of vuejs components, because now it's two types of components: native vuejs and bootstraping with sharedController provided in props. |
I don't think I understand your last comment and how it relates to the solution I suggested. But to be concise, your created () {
this.sharedController = sharedController
} If this doesn't work due to other constraints, then you didn't provide enough context. Either way, this should not be solved by adding a hotreload hook. |
Ok. Let's make it simplier. |
Did you understand my suggestion? |
Hm. It works, but it's kind'a injecting in component. I can accidently replace some important property. I suggested that there is only several safe spaces for state: data, props. |
I tested some time solution with 'created' method. I've found that it works only in this simple case, that I mentioned above.
So, I have two solutions:
Pros:
Cons:
|
No description provided.