-
Notifications
You must be signed in to change notification settings - Fork 4.7k
First example in introduction doesn't demonstrate reactivity #253
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
Comments
@Aurelius333 Thank you for the super valuable feedback! Unfortunately, it's not possible with VuePress (and it's also far from best practice) to attach the global property to I totally understand and share the concern but I can't come with a good solution to resolve it with the current stack. We could create a component that exposes an input field (with I am open to any ideas here 😅 |
Here's my possible solution: master...Aurelius333:intro-reactivity-examples-without-codepen. For the first and third examples, I removed the CodePens and added components into mounted() {
window.HelloVueVm = this
} In the example code on the page, I assigned the last line of the first example to const HelloVueVm = Vue.createApp(HelloVueApp).mount('#hello-vue') That way, in both the code example and on the actual page, you can do There are some disadvantages to this approach:
I think it might be worth it to have a quick example of reactivity that you can run in the console, but I understand if it's not worth the tradeoff. |
Mobile users don't have an easy access to browsers console, I think this should be considered as well. For me personally it is enough for the first example to be a simple input field and a text value synced with the field. That I think singlehandedly showcases what problems Vue solves. |
[RxJS](https://rxjs.dev/) 是否有一个用于处理异步事件流的库 --> [RxJS](https://rxjs.dev/) 是一个用于处理异步事件流的库
In the very first example in the new introduction, it says:
However, I'm not sure that changing the code snippet in the CodePen really demonstrates reactivity, since that seems to just restart the CodePen with a different initial state.
Those first examples in the v2 docs were helpful for me in understanding what reactivity means in Vue, so I wonder if it's worth changing the first and third examples to run directly on the page like in the v2 docs so that the app can be exposed to the console. As a reminder, the v2 docs said:
Thank you all for your hard work!
The text was updated successfully, but these errors were encountered: