diff --git a/README.md b/README.md index 5443cc56a2..86dc20a48e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ See the [Vue Docs Writing Guide](https://v3.vuejs.org/guide/writing-guide.html) 1. Clone repository ```bash -git clone git@github.com:vuejs/docs.git +git clone https://github.com/vuejs/docs.git ``` 2. Install dependencies diff --git a/src/.vuepress/components/community/themes/theme-data.js b/src/.vuepress/components/community/themes/theme-data.js index 4604a5ea2e..7e0d9ffc1b 100644 --- a/src/.vuepress/components/community/themes/theme-data.js +++ b/src/.vuepress/components/community/themes/theme-data.js @@ -127,7 +127,7 @@ export default [ }, { name: 'PrimeVue', - description: `The open-source UI component library [PrimeVue](https://www.primefaces.org/primevue/#/?af_id=4218) offers over 80 flexible components to build your apps with! They have a ton of different component themes and Vue-CLI application templates available to get the look&feel that suits you best.`, + description: `The open-source UI component library [PrimeVue](https://www.primefaces.org/primevue/#/?af_id=4218) offers over 80 flexible components to build your apps with! They have a ton of different component themes and Vue-CLI application templates available to get the look & feel that suits you best.`, seeMoreUrl: 'https://www.primefaces.org/primevue/#/?af_id=4218', products: [ { @@ -218,7 +218,7 @@ export default [ }, { name: 'Flatlogic', - description: `Check the admin dashboards templates built by our partners from [Flatlogic](https://flatlogic.com/templates?ref=x-fdkuTAVW). With these themes you can see how real applications is built. Additionally these templates will help you to start a new application and save you time and money.`, + description: `Check out the admin dashboard templates built by our partners from [Flatlogic](https://flatlogic.com/templates?ref=x-fdkuTAVW). With these themes you can see how real applications are built. Additionally, these templates will help you to start a new application and save you time and money.`, seeMoreUrl: 'https://flatlogic.com/templates?ref=x-fdkuTAVW', products: [ { diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index c86fe52d07..3370925c2c 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -274,7 +274,7 @@ module.exports = { 'link', { href: - 'https://fonts.googleapis.com/css?family=Inter:300,400,500,600|Archivo:400,600|Open+Sans:400,600;display=swap', + 'https://fonts.googleapis.com/css?family=Inter:300,400,500,600|Open+Sans:400,600;display=swap', rel: 'stylesheet' } ], diff --git a/src/.vuepress/public/images/vueschool/extended.svg b/src/.vuepress/public/images/vueschool/extended.svg deleted file mode 100644 index 192d76b2f9..0000000000 --- a/src/.vuepress/public/images/vueschool/extended.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/.vuepress/public/images/vueschool/tech-coin-js.png b/src/.vuepress/public/images/vueschool/tech-coin-js.png deleted file mode 100644 index 14e506f28c..0000000000 Binary files a/src/.vuepress/public/images/vueschool/tech-coin-js.png and /dev/null differ diff --git a/src/.vuepress/public/images/vueschool/tech-coin-nuxt.png b/src/.vuepress/public/images/vueschool/tech-coin-nuxt.png deleted file mode 100644 index f7e2189dcd..0000000000 Binary files a/src/.vuepress/public/images/vueschool/tech-coin-nuxt.png and /dev/null differ diff --git a/src/.vuepress/public/images/vueschool/tech-coin-ts.png b/src/.vuepress/public/images/vueschool/tech-coin-ts.png deleted file mode 100644 index f34f41448e..0000000000 Binary files a/src/.vuepress/public/images/vueschool/tech-coin-ts.png and /dev/null differ diff --git a/src/.vuepress/public/images/vueschool/tech-coin-vue.png b/src/.vuepress/public/images/vueschool/tech-coin-vue.png deleted file mode 100644 index 201246e6fa..0000000000 Binary files a/src/.vuepress/public/images/vueschool/tech-coin-vue.png and /dev/null differ diff --git a/src/.vuepress/public/images/vueschool/tech-coin-vuex.png b/src/.vuepress/public/images/vueschool/tech-coin-vuex.png deleted file mode 100644 index aa04881939..0000000000 Binary files a/src/.vuepress/public/images/vueschool/tech-coin-vuex.png and /dev/null differ diff --git a/src/.vuepress/public/images/vueschool/vueschool_banner_mobile.png b/src/.vuepress/public/images/vueschool/vueschool_banner_mobile.png deleted file mode 100644 index 590a15a4f3..0000000000 Binary files a/src/.vuepress/public/images/vueschool/vueschool_banner_mobile.png and /dev/null differ diff --git a/src/.vuepress/public/images/vueschool/vueschool_blackfriday_background_tablet_2.svg b/src/.vuepress/public/images/vueschool/vueschool_blackfriday_background_tablet_2.svg deleted file mode 100644 index ed53dc0f14..0000000000 --- a/src/.vuepress/public/images/vueschool/vueschool_blackfriday_background_tablet_2.svg +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/.vuepress/public/images/vueschool/vueschool_blackfriday_logo.svg b/src/.vuepress/public/images/vueschool/vueschool_blackfriday_logo.svg deleted file mode 100644 index 351c55977e..0000000000 --- a/src/.vuepress/public/images/vueschool/vueschool_blackfriday_logo.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/.vuepress/public/images/vueschool/vueschool_close.svg b/src/.vuepress/public/images/vueschool/vueschool_close.svg deleted file mode 100644 index 0e2f31fcd4..0000000000 --- a/src/.vuepress/public/images/vueschool/vueschool_close.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/.vuepress/theme/components/BannerCoins.vue b/src/.vuepress/theme/components/BannerCoins.vue deleted file mode 100644 index 108cd95556..0000000000 --- a/src/.vuepress/theme/components/BannerCoins.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/src/.vuepress/theme/components/BannerTop.vue b/src/.vuepress/theme/components/BannerTop.vue deleted file mode 100644 index 6e3e1a9eba..0000000000 --- a/src/.vuepress/theme/components/BannerTop.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - - - diff --git a/src/.vuepress/theme/layouts/Layout.vue b/src/.vuepress/theme/layouts/Layout.vue index 18d91ca121..10e09d60bd 100644 --- a/src/.vuepress/theme/layouts/Layout.vue +++ b/src/.vuepress/theme/layouts/Layout.vue @@ -66,7 +66,9 @@ export default { data() { return { - isSidebarOpen: false + isSidebarOpen: false, + isMenuFixed: false, + menuPosition: 0 } }, @@ -110,8 +112,7 @@ export default { { 'no-navbar': !this.shouldShowNavbar, 'sidebar-open': this.isSidebarOpen, - 'no-sidebar': !this.shouldShowSidebar, - 'has-top-banner': this.showTopBanner + 'no-sidebar': !this.shouldShowSidebar }, userPageClass ] diff --git a/src/api/application-api.md b/src/api/application-api.md index f18b560d9a..b6a1470cc8 100644 --- a/src/api/application-api.md +++ b/src/api/application-api.md @@ -235,7 +235,7 @@ app.mount('#my-app') Providing values via the application is especially useful when writing plugins, as plugins typically wouldn't be able to provide values using components. It is an alternative to using [globalProperties](application-config.html#globalproperties). :::tip Note - The `provide` and `inject` bindings are NOT reactive. This is intentional. However, if you pass down an observed object, properties on that object do remain reactive. + The `provide` and `inject` bindings are NOT reactive. This is intentional. However, if you pass down a reactive object, properties on that object do remain reactive. ::: - **Example:** @@ -298,9 +298,9 @@ setTimeout(() => app.unmount(), 5000) - **Usage:** - Install a Vue.js plugin. If the plugin is an Object, it must expose an `install` method. If it is a function itself, it will be treated as the install method. + Install a Vue.js plugin. If the plugin is an Object, it must expose an `install` method. If it is a function itself, it will be treated as the `install` method. - The install method will be called with the application as its first argument. Any `options` passed to `use` will be passed on in subsequent arguments. + The `install` method will be called with the application as its first argument. Any `options` passed to `use` will be passed on in subsequent arguments. When this method is called on the same plugin multiple times, the plugin will be installed only once. diff --git a/src/api/application-config.md b/src/api/application-config.md index 0bd8bdc2b1..b53487fe81 100644 --- a/src/api/application-config.md +++ b/src/api/application-config.md @@ -26,7 +26,7 @@ app.config.errorHandler = (err, vm, info) => { } ``` -Assign a handler for uncaught errors during component render function and watchers. The handler gets called with the error and the application instance. +Assign a handler for uncaught errors during component render function and watchers. The handler gets called with the error and the corresponding application instance. > Error tracking services [Sentry](https://sentry.io/for/vue/) and [Bugsnag](https://docs.bugsnag.com/platforms/browsers/vue/) provide official integrations using this option. @@ -146,7 +146,7 @@ This config option is only respected when using the full build (i.e. the standal app.config.compilerOptions.isCustomElement = tag => tag.startsWith('ion-') ``` -Specifies a method to recognize custom elements defined outside of Vue (e.g., using the Web Components APIs). If component matches this condition, it won't need local or global registration and Vue won't throw a warning about an `Unknown custom element`. +Specifies a method to recognize custom elements defined outside of Vue (e.g., using the Web Components APIs). If a component matches this condition, it won't need local or global registration and Vue won't throw a warning about an `Unknown custom element`. > Note that all native HTML and SVG tags don't need to be matched in this function - Vue parser performs this check automatically. diff --git a/src/api/global-api.md b/src/api/global-api.md index 6527cb5a50..eec4d7c9e8 100644 --- a/src/api/global-api.md +++ b/src/api/global-api.md @@ -193,9 +193,7 @@ createApp({ }) ``` -For advanced usage, `defineAsyncComponent` can accept an object: - -The `defineAsyncComponent` method can also return an object of the following format: +For advanced usage, `defineAsyncComponent` can accept an object of the following format: ```js import { defineAsyncComponent } from 'vue' diff --git a/src/api/sfc-script-setup.md b/src/api/sfc-script-setup.md index cf73d9356c..fcf0462278 100644 --- a/src/api/sfc-script-setup.md +++ b/src/api/sfc-script-setup.md @@ -223,7 +223,7 @@ const attrs = useAttrs() ` + + +``` + ### Type-only props/emit declarations Props and emits can also be declared using pure-type syntax by passing a literal type argument to `defineProps` or `defineEmits`: diff --git a/src/coc/index.md b/src/coc/index.md index fd53230a08..29a950b967 100644 --- a/src/coc/index.md +++ b/src/coc/index.md @@ -2,7 +2,7 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct. +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct. ## Our Standards diff --git a/src/community/join.md b/src/community/join.md index b78cbf359c..bb4ef014b4 100644 --- a/src/community/join.md +++ b/src/community/join.md @@ -41,7 +41,7 @@ After that, you'll be ready to contribute to Vue's core repositories: Apart from answering questions and sharing resources in the forum and chat, there are a few other less obvious ways to share and expand what you know: - **Develop learning materials.** It's often said that the best way to learn is to teach. If there's something interesting you're doing with Vue, strengthen your expertise by writing a blog post, developing a workshop, or even publishing a gist that you share on social media. -- **Watch a repo you care about.** This will send you notifications whenever there's activity in that repository, giving you insider knowledge about ongoing discussions and upcoming features. It's a fantastic way to build expertise so that you're eventually able to help address issues and pull requests. +- **Watch a repo you care about.** This will send you notifications whenever there's an activity in that repository, giving you insider knowledge about ongoing discussions and upcoming features. It's a fantastic way to build expertise so that you're eventually able to help address issues and pull requests. ### Translate Docs diff --git a/src/cookbook/debugging-in-vscode.md b/src/cookbook/debugging-in-vscode.md index 2694ce379f..f43f789a77 100644 --- a/src/cookbook/debugging-in-vscode.md +++ b/src/cookbook/debugging-in-vscode.md @@ -1,6 +1,6 @@ # Debugging in VS Code -Every application reaches a point where it's necessary to understand failures, small to large. In this recipe, we explore a few workflows for VS Code users who would like to debug their application in the browser. +Every application reaches a point where it's necessary to understand failures, small to large. In this recipe, we explore a few workflows for VS Code users who would like to debug their applications in the browser. This recipe shows how to debug [Vue CLI](https://github.com/vuejs/vue-cli) applications in VS Code as they run in the browser. diff --git a/src/cookbook/editable-svg-icons.md b/src/cookbook/editable-svg-icons.md index 360a076777..c0f85ce5e7 100644 --- a/src/cookbook/editable-svg-icons.md +++ b/src/cookbook/editable-svg-icons.md @@ -2,7 +2,7 @@ ## Base Example -There are many ways to create an SVG Icon System, but one method that takes advantage of Vue's capabilities is to create editable inline icons as components. Some of the advantages of this way of working is: +There are many ways to create an SVG Icon System, but one method that takes advantage of Vue's capabilities is to create editable inline icons as components. Some of the advantages of this way of working are: - They are easy to edit on the fly - They are animatable @@ -141,7 +141,7 @@ export default { } ``` -We're applying `refs` to the groups of paths we need to move, and as both sides of the scissors have to move in tandem, we'll create a function we can reuse where we'll pass in the `refs`. The use of GreenSock helps resolve animation support and `transform-origin` issues across browser. +We're applying `refs` to the groups of paths we need to move, and as both sides of the scissors have to move in tandem, we'll create a function we can reuse where we'll pass in the `refs`. The use of GreenSock helps resolve animation support and `transform-origin` issues across browsers. @@ -151,7 +151,7 @@ You can see more animated examples in the repo [here](https://github.com/sdras/v ## Additional Notes -Designers may change their minds. Product requirements change. Keeping the logic for the entire icon system in one base component means you can quickly update all of your icons and have it propagate through the whole system. Even with the use of an icon loader, some situations require you to recreate or edit every SVG to make global changes. This method can save you that time and pain. +Designers may change their minds. Product requirements change. Keeping the logic for the entire icon system in one base component means you can quickly update all of your icons and have them propagate through the whole system. Even with the use of an icon loader, some situations require you to recreate or edit every SVG to make global changes. This method can save you that time and pain. ## When To Avoid This Pattern @@ -164,4 +164,4 @@ Other tooling to help manage SVG icons includes: - [svg-sprite-loader](https://github.com/kisenka/svg-sprite-loader) - [svgo-loader](https://github.com/rpominov/svgo-loader) -These tools bundle SVGs at compile time, but make them a little harder to edit during runtime, because `` tags can have strange cross-browser issues when doing anything more complex. They also leave you with two nested `viewBox` properties and thus two coordinate systems. This makes the implementation a little more complex. +These tools bundle SVGs at time of compilation, but make them a little harder to edit during runtime, because `` tags can have strange cross-browser issues when doing anything more complex. They also leave you with two nested `viewBox` properties and thus two coordinate systems. This makes the implementation a little more complex. diff --git a/src/cookbook/index.md b/src/cookbook/index.md index 13060edb85..d384e3118a 100644 --- a/src/cookbook/index.md +++ b/src/cookbook/index.md @@ -66,7 +66,7 @@ It's extremely helpful to write a bit about this pattern, where else it would ap ### When To Avoid This Pattern -This section is not required, but heavily recommended. It won't make sense to write it for something very simple such as toggling classes based on state change, but for more advanced patterns like mixins it's vital. The answer to most questions about development is ["It depends!"](https://codepen.io/rachsmith/pen/YweZbG), this section embraces that. Here, we'll take an honest look at when the pattern is useful and when it should be avoided, or when something else makes more sense. +This section is not required but heavily recommended. It won't make sense to write it for something very simple such as toggling classes based on state change, but for more advanced patterns like mixins, it's vital. The answer to most questions about development is ["It depends!"](https://codepen.io/rachsmith/pen/YweZbG), this section embraces that. Here, we'll take an honest look at when the pattern is useful and when it should be avoided, or when something else makes more sense. ### Alternative Patterns diff --git a/src/guide/a11y-basics.md b/src/guide/a11y-basics.md index e55d2648a8..5e5e30f3cb 100644 --- a/src/guide/a11y-basics.md +++ b/src/guide/a11y-basics.md @@ -1,6 +1,6 @@ # Basics -Web accessibility (also known as a11y) refers to the practice of creating websites that can be used by anyone — be that a person with a disability, a slow connection, outdated or broken hardware or simply someone in an unfavorable environment. For example, adding subtitles to a video would help both your deaf and hard-of-hearing users and your users who are in a loud environment and can't hear their phone. Similarly, making sure your text isn't too low contrast will help both your low-vision users and your users who are trying to use their phone in bright sunlight. +Web accessibility (also known as a11y) refers to the practice of creating websites that can be used by anyone — be that a person with a disability, a slow connection, outdated or broken hardware, or simply someone in an unfavorable environment. For example, adding subtitles to a video would help both your deaf and hard-of-hearing users and your users who are in a loud environment and can't hear their phones. Similarly, making sure your text isn't too low contrast will help both your low-vision users and your users who are trying to use their phones in bright sunlight. Ready to start but aren’t sure where? @@ -8,7 +8,7 @@ Checkout the [Planning and managing web accessibility guide](https://www.w3.org/ ## Skip link -You should add a link at the top of each page that goes directly to the main content area so users can skip content that is repeated on multiple Web pages. +You should add a link at the top of each page that goes directly to the main content area so that users can skip content that was repeated on multiple Web pages. Typically this is done on the top of `App.vue` as it will be the first focusable element on all your pages: diff --git a/src/guide/component-attrs.md b/src/guide/component-attrs.md index a4dd3e620c..691a7fa6d3 100644 --- a/src/guide/component-attrs.md +++ b/src/guide/component-attrs.md @@ -82,7 +82,7 @@ If you do **not** want a component to automatically inherit attributes, you can The common scenario for disabling an attribute inheritance is when attributes need to be applied to other elements besides the root node. -By setting the `inheritAttrs` option to `false`, you can control to apply to other elements attributes to use the component's `$attrs` property, which includes all attributes not included to component `props` and `emits` properties (e.g., `class`, `style`, `v-on` listeners, etc.). +By setting the `inheritAttrs` option to `false`, you can then apply attributes to the element of your choice by using the component's `$attrs` property, which includes all attributes not included to component `props` and `emits` properties (e.g., `class`, `style`, `v-on` listeners, etc.). Using our date-picker component example from the [previous section](#attribute-inheritance), in the event we need to apply all non-prop attributes to the `input` element rather than the root `div` element, this can be accomplished by using the `v-bind` shortcut. diff --git a/src/guide/component-props.md b/src/guide/component-props.md index c38a42dad2..6a2a45f264 100644 --- a/src/guide/component-props.md +++ b/src/guide/component-props.md @@ -154,8 +154,8 @@ computed: { } ``` -::: tip Note -Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component **will** affect parent state. +::: warning Warning +Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component **will** affect the parent state and Vue is unable to warn you against this. As a general rule, you should avoid mutating any prop, including objects and arrays as doing so ignores one-way data binding and may cause undesired results. ::: ## Prop Validation diff --git a/src/guide/component-slots.md b/src/guide/component-slots.md index ed3daa2b32..9bbab509b7 100644 --- a/src/guide/component-slots.md +++ b/src/guide/component-slots.md @@ -25,7 +25,7 @@ Then in the template for ``, you might have: ``` -When the component renders, `` will be replaced by "Add Todo". +When the component renders, `` will be replaced by "Add todo". ```html diff --git a/src/guide/composition-api-introduction.md b/src/guide/composition-api-introduction.md index 695cc9cacb..079c380bfe 100644 --- a/src/guide/composition-api-introduction.md +++ b/src/guide/composition-api-introduction.md @@ -67,7 +67,7 @@ It would be much nicer if we could collocate code related to the same logical co ## Basics of Composition API -Now that we know the **why** we can get to the **how**. To start working with the Composition API we first need a place where we can actually use it. In a Vue component, we call this place the `setup`. +Now that we know the **why**, we can get to the **how**. To start working with the Composition API we first need a place where we can actually use it. In a Vue component, we call this place the `setup`. ### `setup` Component Option diff --git a/src/guide/composition-api-setup.md b/src/guide/composition-api-setup.md index 1e113308c8..b9c828b48d 100644 --- a/src/guide/composition-api-setup.md +++ b/src/guide/composition-api-setup.md @@ -103,7 +103,7 @@ We'll explain the role of `expose` shortly. ## Accessing Component Properties -When `setup` is executed, the component instance has not been created yet. As a result, you will only be able to access the following properties: +When `setup` is executed, you will only be able to access the following properties: - `props` - `attrs` diff --git a/src/guide/custom-directive.md b/src/guide/custom-directive.md index 4d7a0a6152..0f0d8b6db5 100644 --- a/src/guide/custom-directive.md +++ b/src/guide/custom-directive.md @@ -49,7 +49,7 @@ A directive definition object can provide several hook functions (all optional): - `beforeMount`: called when the directive is first bound to the element and before parent component is mounted. -- `mounted`: called when the bound element's parent component is mounted. +- `mounted`: called before the bound element's parent component is mounted. - `beforeUpdate`: called before the containing component's VNode is updated diff --git a/src/guide/events.md b/src/guide/events.md index 8b7f81b289..b6104cf059 100644 --- a/src/guide/events.md +++ b/src/guide/events.md @@ -171,7 +171,7 @@ To address this problem, Vue provides **event modifiers** for `v-on`. Recall tha ``` ::: tip -Order matters when using modifiers because the relevant code is generated in the same order. Therefore using `@click.prevent.self` will prevent **all clicks** while `@click.self.prevent` will only prevent clicks on the element itself. +Order matters when using modifiers because the relevant code is generated in the same order. Therefore using `@click.prevent.self` will prevent **clicks default action on the element itself and its children** while `@click.self.prevent` will only prevent clicks default action on the element itself. ::: ```html diff --git a/src/guide/installation.md b/src/guide/installation.md index 7f396dc3ab..7cd93128a8 100644 --- a/src/guide/installation.md +++ b/src/guide/installation.md @@ -18,7 +18,7 @@ Detailed release notes for each version are available on [GitHub](https://github ## Vue Devtools > Currently in Beta - Vuex and Router integration is still WIP - + Learn how to install and use Vue Devtools in a free Vue School lesson When using Vue, we recommend also installing the [Vue Devtools](https://github.com/vuejs/vue-devtools#vue-devtools) in your browser, allowing you to inspect and debug your Vue applications in a more user-friendly interface. @@ -117,6 +117,15 @@ $ yarn $ yarn dev ``` +Or with pnpm: + +```bash +$ pnpm create vite -- --template vue +$ cd +$ pnpm install +$ pnpm dev +``` + ## Explanation of Different Builds In the [`dist/` directory of the npm package](https://cdn.jsdelivr.net/npm/vue@3.0.2/dist/) you will find many different builds of Vue.js. Here is an overview of which `dist` file should be used depending on the use-case. diff --git a/src/guide/introduction.md b/src/guide/introduction.md index 93cef89efb..301adefe22 100644 --- a/src/guide/introduction.md +++ b/src/guide/introduction.md @@ -52,7 +52,7 @@ const Counter = { Vue.createApp(Counter).mount('#counter') ``` -We have already created our very first Vue app! This looks pretty similar to rendering a string template, but Vue has done a lot of work under the hood. The data and the DOM are now linked, and everything is now **reactive**. How do we know? Take a look at the example below where `counter` property increments every second and you will see how rendered DOM changes: +We have already created our very first Vue app! This looks pretty similar to rendering a string template, but Vue has done a lot of work under the hood. The data and the DOM are now linked, and everything is now **reactive**. How do we know? Take a look at the example below where the `counter` property increments every second and you will see how the rendered DOM changes: ```js{8-10} const Counter = { @@ -158,7 +158,7 @@ Vue.createApp(TwoWayBinding).mount('#two-way-binding') ## Conditionals and Loops -It's easy to toggle the presence of an element, too: +It's easy to toggle the presence of an element too: ```html
@@ -220,7 +220,7 @@ The component system is another important concept in Vue, because it's an abstra ![Component Tree](/images/components.png) -In Vue, a component is essentially an instance with pre-defined options. Registering a component in Vue is straightforward: we create a component object as we did with `App` objects and we define it in parent's `components` option: +In Vue, a component is essentially an instance with pre-defined options. Registering a component in Vue is straightforward: we create a component object as we did with the `app` object and we define it in the parent's `components` option: ```js const TodoItem = { @@ -251,10 +251,10 @@ Now you can compose it in another component's template: But this would render the same text for every todo, which is not super interesting. We should be able to pass data from the parent scope into child components. Let's modify the component definition to make it accept a [prop](component-basics.html#passing-data-to-child-components-with-props): ```js -app.component('todo-item', { +const TodoItem = { props: ['todo'], template: `
  • {{ todo.text }}
  • ` -}) +} ``` Now we can pass the todo into each repeated component using `v-bind`: @@ -278,6 +278,11 @@ Now we can pass the todo into each repeated component using `v-bind`: ``` ```js +const TodoItem = { + props: ['todo'], + template: `
  • {{ todo.text }}
  • ` +} + const TodoList = { data() { return { @@ -287,22 +292,20 @@ const TodoList = { { id: 2, text: 'Whatever else humans are supposed to eat' } ] } + }, + components: { + TodoItem } } const app = Vue.createApp(TodoList) -app.component('todo-item', { - props: ['todo'], - template: `
  • {{ todo.text }}
  • ` -}) - app.mount('#todo-list-app') ``` -This is a contrived example, but we have managed to separate our app into two smaller units, and the child is reasonably well-decoupled from the parent via the props interface. We can now further improve our `` component with more complex template and logic without affecting the parent app. +This is a contrived example, but we have managed to separate our app into two smaller units, and the child is reasonably well-decoupled from the parent via the props interface. We can now further improve our `` component with a more complex template and logic without affecting the parent app. In a large application, it is necessary to divide the whole app into components to make development manageable. We will talk a lot more about components [later in the guide](component-basics.html), but here's an (imaginary) example of what an app's template might look like with components: diff --git a/src/guide/migration/introduction.md b/src/guide/migration/introduction.md index b2d5c71151..d86c317795 100644 --- a/src/guide/migration/introduction.md +++ b/src/guide/migration/introduction.md @@ -162,7 +162,7 @@ We are working on a new version of the Devtools with a new UI and refactored int - Note: the beta channel may conflict with the stable version of devtools so you may need to temporarily disable the stable version for the beta channel to work properly. -- For Firefox: [Download the signed extension](https://github.com/vuejs/vue-devtools/releases/tag/v6.0.0-beta.2) (`.xpi` file under Assets) +- For Firefox: [Download the signed extension](https://github.com/vuejs/vue-devtools/releases/tag/v6.0.0-beta.20) (`.xpi` file under Assets) ### IDE Support diff --git a/src/guide/migration/migration-build.md b/src/guide/migration/migration-build.md index 8df38f2903..54fe9edd11 100644 --- a/src/guide/migration/migration-build.md +++ b/src/guide/migration/migration-build.md @@ -20,7 +20,7 @@ While we've tried hard to make the migration build mimic Vue 2 behavior as much - Internet Explorer 11 support: [Vue 3 has officially dropped the plan for IE11 support](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0038-vue3-ie11-support.md). If you still need to support IE11 or below, you will have to stay on Vue 2. -- Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing `vue-server-renderer` with [`@vue/server-renderer`](https://github.com/vuejs/vue-next/tree/master/packages/server-renderer). Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with [Vite](https://vitejs.dev/guide/ssr.html). If you are using [Nuxt.js](https://nuxtjs.org/), it is probably better to wait for Nuxt 3. +- Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing `vue-server-renderer` with [`@vue/server-renderer`](https://github.com/vuejs/vue-next/tree/master/packages/server-renderer). Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with [Vite](https://vitejs.dev/guide/ssr.html). If you are using [Nuxt.js](https://nuxtjs.org/), you can try [Nuxt Bridge, a Nuxt.js 2 to 3 compatibility layer](https://v3.nuxtjs.org/getting-started/bridge/). For complex, production projects, it is probably best to wait for [Nuxt 3 (currently in beta)](https://v3.nuxtjs.org/getting-started/introduction). ### Expectations diff --git a/src/guide/single-file-component.md b/src/guide/single-file-component.md index 55c7b8a07a..595fc444a4 100644 --- a/src/guide/single-file-component.md +++ b/src/guide/single-file-component.md @@ -75,7 +75,7 @@ SFC is a defining feature of Vue as a framework, and is the recommended approach - Static Site Generation (SSG) - Any non-trivial frontends where a build step can be justified for better development experience (DX). -That said, we do realize there are scenarios where SFCs can feel like overkill. This is why Vue can still be used via plain JavaScript without a build step. If you are just looking for enhancing largely static HTML with light interactions, you can also check out [petite-vue](https://github.com/vuejs/petite-vue), a 5kb subset of Vue optimized for progressive enhancement. +That said, we do realize there are scenarios where SFCs can feel like overkill. This is why Vue can still be used via plain JavaScript without a build step. If you are just looking for enhancing largely static HTML with light interactions, you can also check out [petite-vue](https://github.com/vuejs/petite-vue), a 6kb subset of Vue optimized for progressive enhancement. ## What About Separation of Concerns? diff --git a/src/guide/template-syntax.md b/src/guide/template-syntax.md index 9b2c55a555..bcb024e00b 100644 --- a/src/guide/template-syntax.md +++ b/src/guide/template-syntax.md @@ -26,7 +26,7 @@ You can also perform one-time interpolations that do not update on data change b ### Raw HTML -The double mustaches interprets the data as plain text, not HTML. In order to output real HTML, you will need to use the [`v-html` directive](../api/directives.html#v-html): +The double mustaches interpret the data as plain text, not HTML. In order to output real HTML, you will need to use the [`v-html` directive](../api/directives.html#v-html): ```html

    Using mustaches: {{ rawHtml }}

    @@ -38,7 +38,7 @@ The double mustaches interprets the data as plain text, not HTML. In order to ou The contents of the `span` will be replaced with the value of the `rawHtml` property, interpreted as plain HTML - data bindings are ignored. Note that you cannot use `v-html` to compose template partials, because Vue is not a string-based templating engine. Instead, components are preferred as the fundamental unit for UI reuse and composition. ::: tip -Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to [XSS vulnerabilities](https://en.wikipedia.org/wiki/Cross-site_scripting). Only use HTML interpolation on trusted content and **never** on user-provided content +Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to [XSS vulnerabilities](https://en.wikipedia.org/wiki/Cross-site_scripting). Only use HTML interpolation on trusted content and **never** on user-provided content. ::: ### Attributes @@ -145,7 +145,7 @@ You'll see other examples of modifiers later, [for `v-on`](events.md#event-modif ## Shorthands -The `v-` prefix serves as a visual cue for identifying Vue-specific attributes in your templates. This is useful when you are using Vue.js to apply dynamic behavior to some existing markup, but can feel verbose for some frequently used directives. At the same time, the need for the `v-` prefix becomes less important when you are building a [SPA](https://en.wikipedia.org/wiki/Single-page_application), where Vue manages every template. Therefore, Vue provides special shorthands for two of the most often used directives, `v-bind` and `v-on`: +The `v-` prefix serves as a visual cue for identifying Vue-specific attributes in your templates. This is useful when you are using Vue.js to apply dynamic behavior to some existing markup, but can feel verbose for some frequently used directives. At the same time, the need for the `v-` prefix becomes less important when you are building an [SPA](https://en.wikipedia.org/wiki/Single-page_application), where Vue manages every template. Therefore, Vue provides special shorthands for two of the most often used directives, `v-bind` and `v-on`: ### `v-bind` Shorthand diff --git a/src/guide/transitions-overview.md b/src/guide/transitions-overview.md index a1f772b961..ee20b1c262 100644 --- a/src/guide/transitions-overview.md +++ b/src/guide/transitions-overview.md @@ -176,7 +176,7 @@ Easing can also convey the quality of material being animated. Take this pen for -You can get a lot of unique effects and make your animation very stylish by adjusting your easing. CSS allows you to modify this by adjusting a cubic-bezier property, [this playground](https://cubic-bezier.com/#.17,.67,.83,.67) by Lea Verou is very helpful for exploring this. +You can get a lot of unique effects and make your animation very stylish by adjusting your easing. CSS allows you to modify this by adjusting the cubic-bezier function's parameters, [this playground](https://cubic-bezier.com/#.17,.67,.83,.67) by Lea Verou is very helpful for exploring this. Though you can achieve great effects for simple animation with the two handles the cubic-bezier ease offers, JavaScript allows multiple handles, and therefore, allows for much more variance. diff --git a/src/guide/typescript-support.md b/src/guide/typescript-support.md index 8038704762..c8363a08ef 100644 --- a/src/guide/typescript-support.md +++ b/src/guide/typescript-support.md @@ -88,7 +88,7 @@ Or, if you want to combine TypeScript with a [JSX `render` function](/guide/rend For developing Vue applications with TypeScript, we strongly recommend using [Visual Studio Code](https://code.visualstudio.com/), which provides great out-of-the-box support for TypeScript. If you are using [single-file components](./single-file-component.html) (SFCs), get the awesome [Volar extension](https://github.com/johnsoncodehk/volar), which provides TypeScript inference inside SFCs and many other great features. -[WebStorm](https://www.jetbrains.com/webstorm/) also provides out-of-the-box support for both TypeScript and Vue. +[WebStorm](https://www.jetbrains.com/webstorm/) provides out of the box support for both TypeScript and Vue. Other JetBrains IDEs also support them, either out of the box or via [this free plugin](https://plugins.jetbrains.com/plugin/9442-vue-js). ## Defining Vue Components diff --git a/yarn.lock b/yarn.lock index 0f27ca96c5..761d82b5e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3742,9 +3742,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" - integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg== + version "1.14.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" + integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== for-in@^1.0.2: version "1.0.2"