-
Notifications
You must be signed in to change notification settings - Fork 5k
Composition API version #2075
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
Composition API version #2075
Conversation
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
skirtles-code
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I've provided some feedback below. In my opinion, introducing a Composition API version of the first example should be fine, but I don't think we can change the second example. More details below.
src/guide/scaling-up/sfc.md
Outdated
| import { ref } from 'vue'; | ||
| const greeting = ref('Hello World!'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing the indent, the semicolons, and the trailing }:
| import { ref } from 'vue'; | |
| const greeting = ref('Hello World!'); | |
| } | |
| import { ref } from 'vue' | |
| const greeting = ref('Hello World!') |
src/guide/scaling-up/sfc.md
Outdated
|
|
||
| ```js | ||
| import MyComponent from './MyComponent.vue' | ||
| <div class="options-api"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should change this second example. The current example is intended to show importing a .vue file into a plain .js file. It's supposed to illustrate how .vue files are just ES modules. Showing a .vue importing a .vue doesn't quite make the same point about compatibility with normal JavaScript.
The existing example is valid for both the Options API and the Composition API. The components option is common to both.
|
This PR is superseded by #2145. The commits from this PR are included in that PR. |
Description of Problem
Some code examples were missing the composition API/options API variant, toggle button was not switching between the two variants.
Proposed Solution
Added missing Composition API examples.
Additional Information