Skip to content

Commit f1a61a4

Browse files
committed
Merge branch 'master' of https://github.com/vuejs/vuejs.org into vuejs-master
2 parents 0b97db9 + 429fdee commit f1a61a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+52590
-168
lines changed

.github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Note
22
====
3-
We're currently in the process of migrating Vue's documentation to v3. To ensure smooth progress, only PR's that fix critical bugs and/or misinformation will be accepted. If yours is not one of them, consider [creating an issue](https://github.com/vuejs/vuejs.org/issues/new) instead and we will label it as `post-3.0` for later tackling.
3+
This repository is for Vue 1.x and 2.x only. Issues and pull requests related to 3.x are managed in the v3 doc repo: https://github.com/vuejs/docs-next.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# vuejs.org
22

3+
> Important: This repository is for Vue 1.x and 2.x only. Issues and pull requests related to 3.x are managed in the [v3 doc repo](https://github.com/vuejs/docs-next).
4+
35
Niniejsza strona została zbudowana w oparciu o [hexo](http://hexo.io/). Zawartość strony zapisywana jest w formacie Markdown w plikach umieszczonych w `src`. Pull requesty są mile widziane!
46

57
## Pisanie

src/v2/api/index.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,6 @@ type: api
10591059
10601060
- **Details:**
10611061
1062-
<p class="tip">`provide` and `inject` are primarily provided for advanced plugin / component library use cases. It is NOT recommended to use them in generic application code.</p>
1063-
10641062
This pair of options are used together to allow an ancestor component to serve as a dependency injector for all its descendants, regardless of how deep the component hierarchy is, as long as they are in the same parent chain. If you are familiar with React, this is very similar to React's context feature.
10651063
10661064
The `provide` option should be an object or a function that returns an object. This object contains the properties that are available for injection into its descendants. You can use ES2015 Symbols as keys in this object, but only in environments that natively support `Symbol` and `Reflect.ownKeys`.
@@ -1384,10 +1382,14 @@ type: api
13841382
13851383
- **Read only**
13861384
1385+
- **Reactive?** No
1386+
13871387
- **Details:**
13881388
13891389
Used to programmatically access content [distributed by slots](../guide/components.html#Content-Distribution-with-Slots). Each [named slot](../guide/components.html#Named-Slots) has its own corresponding property (e.g. the contents of `v-slot:foo` will be found at `vm.$slots.foo`). The `default` property contains either nodes not included in a named slot or contents of `v-slot:default`.
13901390
1391+
Please note that slots are **not** reactive. If you need a component to re-render based on changes to data passed to a slot, we suggest considering a different strategy that relies on a reactive instance option, such as `props` or `data`.
1392+
13911393
**Note:** `v-slot:foo` is supported in v2.6+. For older versions, you can use the [deprecated syntax](../guide/components-slots.html#Deprecated-Syntax).
13921394
13931395
Accessing `vm.$slots` is most useful when writing a component with a [render function](../guide/render-function.html).

src/v2/cookbook/adding-instance-properties.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ new Vue({
5858
})
5959
```
6060

61-
It would be `"My App"`, then `"The name of some other app"`, because `this.appName` is overwritten ([sort of](https://github.com/getify/You-Dont-Know-JS/blob/2nd-ed/objects-classes/ch5.md)) by `data` when the instance is created. We scope instance properties with `$` to avoid this. You can even use your own convention if you'd like, such as `$_appName` or `ΩappName`, to prevent even conflicts with plugins or future features.
61+
It would be `"My App"`, then `"The name of some other app"`, because `this.appName` is overwritten ([sort of](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/this%20%26%20object%20prototypes/ch5.md)) by `data` when the instance is created. We scope instance properties with `$` to avoid this. You can even use your own convention if you'd like, such as `$_appName` or `ΩappName`, to prevent even conflicts with plugins or future features.
6262

6363
## Real-World Example: Replacing Vue Resource with Axios
6464

src/v2/cookbook/dockerize-vuejs-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ So, delivering our Vue.js app as a Docker image helps reducing, if not removing
121121

122122
### Effects of Continuous Delivery
123123

124-
By leveraging the [Continuous Delivery](https://martinfowler.com/bliki/ContinuousDelivery.html) discipline we build our software in a way that it can potentially be released to production at any time. Such engineering practice is enabled by means of what is normally called [continuous delivery pipeline](https://martinfowler.com/bliki/DeploymentPipeline.html). The purpose of a continuous delivery pipeline is to split our build into stages (e.g. compilation, unit tests, integration tests, performance tests, etc.) and let each stage verify our build artifact whenever our software changes. Ultimately, each stage increases our confidence in the production readiness of our build artifact and, therefore, reduces the risk of breaking things in production (or any other environment for that matters).
124+
By leveraging the [Continuous Delivery](https://martinfowler.com/bliki/ContinuousDelivery.html) discipline we build our software in a way that it can potentially be released to production at any time. Such engineering practice is enabled by means of what is normally called [continuous delivery pipeline](https://martinfowler.com/bliki/DeploymentPipeline.html). The purpose of a continuous delivery pipeline is to split our build into stages (e.g. compilation, unit tests, integration tests, performance tests, etc.) and let each stage verify our build artifact whenever our software changes. Ultimately, each stage increases our confidence in the production readiness of our build artifact and, therefore, reduces the risk of breaking things in production (or any other environment for that matter).
125125

126126
So, creating a Docker image for our Vue.js app is a good choice here because that would represent our final build artifact, the same artifact that would be verified against our continuous delivery pipeline and that could potentially be released to production with confidence.
127127

src/v2/guide/comparison.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ React is renowned for its steep learning curve. Before you can really get starte
111111
While Vue scales up just as well as React, it also scales down just as well as jQuery. That's right - to get started, all you have to do is drop a single script tag into the page:
112112

113113
``` html
114-
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
114+
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
115115
```
116116

117117
Then you can start writing Vue code and even ship the minified version to production without feeling guilty or having to worry about performance problems.

src/v2/guide/components-dynamic-async.md

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ new Vue({
106106
background: #f0f0f0;
107107
margin-bottom: -1px;
108108
margin-right: -1px;
109+
overflow-anchor: none;
109110
}
110111
.dynamic-component-demo-tab-button:hover {
111112
background: #e0e0e0;

src/v2/guide/components-props.md

+1
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ This pattern allows you to use base components more like raw HTML elements, with
347347

348348
```html
349349
<base-input
350+
label="Username:"
350351
v-model="username"
351352
required
352353
placeholder="Enter your username"

src/v2/guide/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ The easiest way to try out Vue.js is using the [Hello World example](https://cod
2424

2525
``` html
2626
<!-- development version, includes helpful console warnings -->
27-
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
27+
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
2828
```
2929

3030
or:
3131

3232
``` html
3333
<!-- production version, optimized for size and speed -->
34-
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
34+
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
3535
```
3636

3737
The [Installation](installation.html) page provides more options of installing Vue. Note: We **do not** recommend that beginners start with `vue-cli`, especially if you are not yet familiar with Node.js-based build tools.

src/v2/guide/installation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Pobierz i uwzględnij tag script. `Vue` zostanie zarejestrowane jako zmienna glo
4141

4242
Aby zacząć prototypowanie lub naukę, możesz skorzystać z najnowszej wersji za pomocą:
4343

44-
```html
45-
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
44+
``` html
45+
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
4646
```
4747

4848
W produkcji, zalecamy użycie określonego numeru wersji i kompilacji, aby uniknąć niespodziewanych błędów spowodowanych nowszą wersją:

src/v2/guide/instance.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ A Vue application consists of a **root Vue instance** created with `new Vue`, op
2424
Root Instance
2525
└─ TodoList
2626
├─ TodoItem
27-
│ ├─ DeleteTodoButton
28-
│ └─ EditTodoButton
27+
│ ├─ TodoButtonDelete
28+
│ └─ TodoButtonEdit
2929
└─ TodoListFooter
30-
├─ ClearTodosButton
30+
├─ TodosButtonClear
3131
└─ TodoListStatistics
3232
```
3333

src/v2/guide/syntax.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ These expressions will be evaluated as JavaScript in the data scope of the owner
9898
{{ if (ok) { return message } }}
9999
```
100100

101-
<p class="tip">Template expressions are sandboxed and only have access to a [whitelist of globals](https://github.com/vuejs/vue/blob/v2.6.10/src/core/instance/proxy.js#L9) such as `Math` and `Date`. You should not attempt to access user defined globals in template expressions.</p>
101+
<p class="tip">Template expressions are sandboxed and only have access to a [whitelist of globals](https://github.com/vuejs/vue/blob/v2.6.10/src/core/instance/proxy.js#L9) such as `Math` and `Date`. You should not attempt to access user-defined globals in template expressions.</p>
102102

103103
## Directives
104104

@@ -167,7 +167,7 @@ Dynamic argument expressions have some syntax constraints because certain charac
167167

168168
The workaround is to either use expressions without spaces or quotes, or replace the complex expression with a computed property.
169169

170-
When using in-DOM templates (templates directly written in an HTML file), you should also avoid naming keys with uppercase characters, as browsers will coerce attribute names into lowercase:
170+
When using in-DOM templates (i.e., templates written directly in an HTML file), you should also avoid naming keys with uppercase characters, as browsers will coerce attribute names into lowercase:
171171

172172
``` html
173173
<!--

src/v2/guide/team.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,19 @@ order: 803
412412
languages: ['hi', 'en'],
413413
work: {
414414
role: 'Software Engineer',
415-
org: 'Myntra',
416-
orgUrl: 'https://www.myntra.com/'
415+
org: 'Grammarly',
416+
orgUrl: 'https://grammarly.com/'
417417
},
418418
github: 'znck',
419419
twitter: 'znck0',
420420
reposOfficial: [
421421
'rollup-plugin-vue', 'vue-issue-helper'
422422
],
423423
reposPersonal: [
424-
'keynote', 'bootstrap-for-vue', 'vue-interop'
424+
'vue-developer-experience', 'prop-types', 'grammarly'
425425
],
426426
links: [
427-
'https://znck.me', 'https://www.codementor.io/znck'
427+
'https://znck.me'
428428
]
429429
},
430430
{
@@ -795,6 +795,7 @@ order: 803
795795
role: 'Organizer',
796796
org: 'VueConf US'
797797
},
798+
imageUrl:'https://pbs.twimg.com/profile_images/1541624512/profile-pic-09-11-2011_400x400.png',
798799
twitter: 'prpatel',
799800
links: [
800801
'https://us.vuejs.org/'
@@ -809,6 +810,7 @@ order: 803
809810
role: 'Organizer',
810811
org: 'VueConf US'
811812
},
813+
imageUrl:'https://pbs.twimg.com/profile_images/916531463905992706/MNvTkO5K_400x400.jpg',
812814
twitter: 'vincentmayers',
813815
links: [
814816
'https://us.vuejs.org/'
@@ -823,6 +825,7 @@ order: 803
823825
role: 'Creator',
824826
org: 'Vue.js Amsterdam'
825827
},
828+
imageUrl: 'https://pbs.twimg.com/profile_images/1123492769299877888/aviXE_M5_400x400.jpg',
826829
twitter: 'lukevscostas',
827830
linkedin: 'luke-kenneth-thomas-578b3916a',
828831
links: [
@@ -838,6 +841,7 @@ order: 803
838841
role: 'Event Manager',
839842
org: 'Vue.js Amsterdam'
840843
},
844+
imageUrl:'https://pbs.twimg.com/profile_images/1110510517951627269/LDzDyd4N_400x400.jpg',
841845
twitter: 'josgerards88',
842846
linkedin: 'josgerards',
843847
links: [
@@ -1201,12 +1205,12 @@ order: 803
12011205
github: 'filrak',
12021206
twitter: 'filrakowski',
12031207
work: {
1204-
role: 'Co-founder of Vue Storefront',
1205-
org: 'Divante',
1206-
orgUrl: 'https://divante.co/'
1208+
role: 'Co-founder & CTO',
1209+
org: 'Vue Storefront',
1210+
orgUrl: 'https://vuestorefront.io'
12071211
},
12081212
reposPersonal: [
1209-
'DivanteLtd/vue-storefront', 'DivanteLtd/storefront-ui'
1213+
'vuestorefront/vue-storefront', 'vuestorefront/storefront-ui'
12101214
],
12111215
links: [
12121216
'https://vuestorefront.io',

src/v2/guide/testing.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ type: guide
44
order: 402
55
---
66

7-
# Testing
8-
97
## Introduction
108

119
When it comes to building reliable applications, tests can play a critical role in an individual or team's ability to build new features, refactor code, fix bugs, etc. While there are many schools of thought with testing, there are three categories often discussed in the context of web applications:
@@ -64,7 +62,7 @@ Mocha is a JavaScript test framework that is focused on being flexible. Because
6462

6563
### Introduction
6664

67-
To test most Vue components, they must be mounted to the DOM (either virtual or real) in order to fully assert that they are working. This is another framework-agnostic concept. As a result, component testing frameworks were created to give users the ability to do this in a reliable way while also providing Vue-specific conveniences such as integrations for Vuex, Vue Router, and other Vue plugins.
65+
To test most Vue components, they must be mounted to the DOM (either virtual or real) in order to fully assert that they are working. This is another framework-agnostic concept. As a result, component testing frameworks were created to give users the ability to do this reliably while also providing Vue-specific conveniences such as integrations for Vuex, Vue Router, and other Vue plugins.
6866

6967
### Choosing Your Framework
7068

@@ -76,7 +74,7 @@ It should be no surprise that one of the first criteria is that a component test
7674

7775
#### First-class error reporting
7876

79-
When tests fail, it is critical that your component testing framework provides useful error logs that help to minimize the amount of time it takes to debug the problem. In addition to simply telling you what test fails, they should also provides context for why a test fails, e.g., what is expected vs what was received.
77+
When tests fail, it is critical that your component testing framework provides useful error logs that help to minimize the amount of time it takes to debug the problem. In addition to simply telling you what test fails, they should also provide context for why a test fails, e.g., what is expected vs what was received.
8078

8179
### Recommendations
8280

@@ -116,9 +114,7 @@ While end-to-end (E2E) testing on the web has gained a negative reputation for u
116114

117115
One of the primary benefits that end-to-end (E2E) testing is known for is its ability to test your application across multiple browsers. While it may seem desirable to have 100% cross-browser coverage, it is important to note that cross browser testing has diminishing returns on a team's resources due the additional time and machine power required to run them consistently. As a result, it is important to be mindful of this trade-off when choosing the amount of cross-browser testing your application needs.
118116

119-
::: tip
120-
A recent development in for catching browser-specific issues is using application monitoring and error reporting tools (e.g., Sentry, LogRocket, etc.) for browsers that are not as commonly used (e.g., < IE11, older Safari versions, etc.).
121-
:::
117+
<p class="tip">A recent development in E2E for catching browser-specific issues is using application monitoring and error reporting tools (e.g., Sentry, LogRocket, etc.) for browsers that are not as commonly used (e.g., < IE11, older Safari versions, etc.).</p>
122118

123119
#### Faster feedback loops
124120

src/v2/guide/typescript.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ type: guide
44
order: 403
55
---
66

7-
> [Vue CLI](https://cli.vuejs.org) provides built-in TypeScript tooling support.
7+
> [Vue CLI](https://cli.vuejs.org) provides built-in TypeScript tooling support.
88
99
## Official Declaration in NPM Packages
1010

1111
A static type system can help prevent many potential runtime errors, especially as applications grow. That's why Vue ships with [official type declarations](https://github.com/vuejs/vue/tree/dev/types) for [TypeScript](https://www.typescriptlang.org/) - not only in Vue core, but also for [vue-router](https://github.com/vuejs/vue-router/tree/dev/types) and [vuex](https://github.com/vuejs/vuex/tree/dev/types) as well.
1212

13-
Since these are [published on NPM](https://cdn.jsdelivr.net/npm/vue/types/), and the latest TypeScript knows how to resolve type declarations in NPM packages, this means when installed via NPM, you don't need any additional tooling to use TypeScript with Vue.
13+
Since these are [published on NPM](https://cdn.jsdelivr.net/npm/vue@2/types/), and the latest TypeScript knows how to resolve type declarations in NPM packages, this means when installed via NPM, you don't need any additional tooling to use TypeScript with Vue.
1414

1515
## Recommended Configuration
1616

@@ -195,7 +195,7 @@ If you find type inference or member completion isn't working, annotating certai
195195
```ts
196196
import Vue, { PropType } from 'vue'
197197

198-
interface ComplexMessage {
198+
interface ComplexMessage {
199199
title: string,
200200
okMessage: string,
201201
cancelMessage: string
@@ -204,7 +204,7 @@ const Component = Vue.extend({
204204
props: {
205205
name: String,
206206
success: { type: String },
207-
callback: {
207+
callback: {
208208
type: Function as PropType<() => void>
209209
},
210210
message: {

src/v2/style-guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Some features of Vue exist to accommodate rare edge cases or smoother migrations
4545

4646
**Component names should always be multi-word, except for root `App` components, and built-in components provided by Vue, such as `<transition>` or `<component>`.**
4747

48-
This [prevents conflicts](http://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name) with existing and future HTML elements, since all HTML elements are a single word.
48+
This [prevents conflicts](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name) with existing and future HTML elements, since all HTML elements are a single word.
4949

5050
{% raw %}<div class="style-example example-bad">{% endraw %}
5151
#### Bad

0 commit comments

Comments
 (0)