You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# vuejs.org
2
2
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
+
3
5
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!
Copy file name to clipboardExpand all lines: src/v2/api/index.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -1059,8 +1059,6 @@ type: api
1059
1059
1060
1060
- **Details:**
1061
1061
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
-
1064
1062
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.
1065
1063
1066
1064
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
1384
1382
1385
1383
- **Read only**
1386
1384
1385
+
- **Reactive?** No
1386
+
1387
1387
- **Details:**
1388
1388
1389
1389
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`.
1390
1390
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
+
1391
1393
**Note:** `v-slot:foo` is supported in v2.6+. For older versions, you can use the [deprecated syntax](../guide/components-slots.html#Deprecated-Syntax).
1392
1394
1393
1395
Accessing `vm.$slots` is most useful when writing a component with a [render function](../guide/render-function.html).
Copy file name to clipboardExpand all lines: src/v2/cookbook/adding-instance-properties.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ new Vue({
58
58
})
59
59
```
60
60
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.
62
62
63
63
## Real-World Example: Replacing Vue Resource with Axios
Copy file name to clipboardExpand all lines: src/v2/cookbook/dockerize-vuejs-app.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ So, delivering our Vue.js app as a Docker image helps reducing, if not removing
121
121
122
122
### Effects of Continuous Delivery
123
123
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).
125
125
126
126
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.
Copy file name to clipboardExpand all lines: src/v2/guide/comparison.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ React is renowned for its steep learning curve. Before you can really get starte
111
111
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:
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.
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.
Copy file name to clipboardExpand all lines: src/v2/guide/syntax.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ These expressions will be evaluated as JavaScript in the data scope of the owner
98
98
{{ if (ok) { return message } }}
99
99
```
100
100
101
-
<pclass="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 userdefined globals in template expressions.</p>
101
+
<pclass="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>
102
102
103
103
## Directives
104
104
@@ -167,7 +167,7 @@ Dynamic argument expressions have some syntax constraints because certain charac
167
167
168
168
The workaround is to either use expressions without spaces or quotes, or replace the complex expression with a computed property.
169
169
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:
Copy file name to clipboardExpand all lines: src/v2/guide/testing.md
+3-7
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ type: guide
4
4
order: 402
5
5
---
6
6
7
-
# Testing
8
-
9
7
## Introduction
10
8
11
9
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
64
62
65
63
### Introduction
66
64
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.
68
66
69
67
### Choosing Your Framework
70
68
@@ -76,7 +74,7 @@ It should be no surprise that one of the first criteria is that a component test
76
74
77
75
#### First-class error reporting
78
76
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.
80
78
81
79
### Recommendations
82
80
@@ -116,9 +114,7 @@ While end-to-end (E2E) testing on the web has gained a negative reputation for u
116
114
117
115
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.
118
116
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
+
<pclass="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>
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.
12
12
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.
14
14
15
15
## Recommended Configuration
16
16
@@ -195,7 +195,7 @@ If you find type inference or member completion isn't working, annotating certai
Copy file name to clipboardExpand all lines: src/v2/style-guide/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Some features of Vue exist to accommodate rare edge cases or smoother migrations
45
45
46
46
**Component names should always be multi-word, except for root `App` components, and built-in components provided by Vue, such as `<transition>` or `<component>`.**
47
47
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.
49
49
50
50
{% raw %}<divclass="style-example example-bad">{% endraw %}
0 commit comments