Skip to content

Commit 41ce164

Browse files
committed
Merge branch 'master' of https://github.com/danielesreis/docs-next into api/lifecycle-hooks-pt-br
2 parents 888d81c + c9383f9 commit 41ce164

Some content is hidden

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

41 files changed

+643
-560
lines changed

src/.vuepress/components/community/team/members.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ const members = [
252252
languages: ['uk', 'ru', 'en'],
253253
reposOfficial: ['vuejs.org', 'vue-cli'],
254254
work: {
255-
role: 'Senior Frontend Engineer',
255+
role: 'Staff Frontend Engineer',
256256
org: 'GitLab',
257257
orgUrl: 'https://gitlab.com/'
258258
},

src/.vuepress/config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const sidebar = {
157157
'/api/global-api',
158158
{
159159
title: 'Options',
160+
path: '/api/options-api',
160161
collapsable: false,
161162
children: [
162163
'/api/options-data',
@@ -174,6 +175,7 @@ const sidebar = {
174175
'/api/built-in-components.md',
175176
{
176177
title: 'Reactivity API',
178+
path: '/api/reactivity-api',
177179
collapsable: false,
178180
children: [
179181
'/api/basic-reactivity',
@@ -252,10 +254,10 @@ module.exports = {
252254
],
253255
['meta', { name: 'msapplication-TileColor', content: '#000000' }],
254256
[
255-
('script',
257+
'script',
256258
{
257259
src: 'https://player.vimeo.com/api/player.js'
258-
})
260+
}
259261
],
260262
[
261263
'script',
@@ -296,7 +298,7 @@ module.exports = {
296298
},
297299
{
298300
text: 'API Reference',
299-
link: '/api/application-config'
301+
link: '/api/'
300302
},
301303
{
302304
text: 'Ecosystem',

src/.vuepress/public/images/css-vs-js-ease.svg

Lines changed: 1 addition & 1 deletion
Loading
-3.78 KB
Loading

src/.vuepress/theme/components/Newsletter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
position: absolute;
7272
padding: 4px 20px;
7373
margin: 0;
74-
height: calc(100% - 8px);
74+
min-height: calc(100% - 8px);
7575
right: 4px;
7676
top: 4px;
7777
font-size: 1.05em;

src/api/composition-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ const foo = inject<string>('foo') // string | undefined
164164
`getCurrentInstance` enables access to an internal component instance useful for advanced usages or for library creators.
165165

166166
```ts
167-
import { getCurrentIntance } from 'vue'
167+
import { getCurrentInstance } from 'vue'
168168
169169
const MyComponent = {
170170
setup() {
171-
const internalIntance = getCurrentInstance()
171+
const internalInstance = getCurrentInstance()
172172
173173
internalInstance.appContext.config.globalProperties // access to globalProperties
174174
}
@@ -182,15 +182,15 @@ const MyComponent = {
182182
```ts
183183
const MyComponent = {
184184
setup() {
185-
const internalIntance = getCurrentInstance() // works
185+
const internalInstance = getCurrentInstance() // works
186186
187187
const id = useComponentId() // works
188188
189189
const handleClick = () => {
190190
getCurrentInstance() // doesn't work
191191
useComponentId() // doesn't work
192192
193-
internalIntance // works
193+
internalInstance // works
194194
}
195195
196196
onMounted(() => {

src/api/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# API
2+
3+
The Vue.js API contains the following categories:
4+
5+
- [Application Config](/api/application-config.html)
6+
- [Application API](/api/application-api.html)
7+
- [Global API](/api/global-api.html)
8+
- [Options API](/api/options-api.html)
9+
- [Instance Properties](/api/instance-properties.html)
10+
- [Instance Methods](/api/instance-methods.html)
11+
- [Directives](/api/directives.html)
12+
- [Special Attributes](/api/special-attributes.html)
13+
- [Built-in Components](/api/built-in-components.html)
14+
- [Reactivity API](/api/reactivity-api.html)
15+
- [Composition API](/api/composition-api.html)

src/api/instance-methods.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- `{Object} options (optional)`
1010
- `{boolean} deep`
1111
- `{boolean} immediate`
12+
- `{string} flush`
1213

1314
- **Returns:** `{Function} unwatch`
1415

@@ -172,6 +173,24 @@
172173
)
173174
```
174175

176+
- **Option: flush**
177+
178+
The `flush` option allows for greater control over the timing of the callback. It can be set to `'pre'`, `'post'` or `'sync'`.
179+
180+
The default value is `'pre'`, which specifies that the callback should be invoked before rendering. This allows the callback to update other values before the template runs.
181+
182+
The value `'post'` can be used to defer the callback until after rendering. This should be used if the callback needs access to the updated DOM or child components via `$refs`.
183+
184+
If `flush` is set to `'sync'`, the callback will be called synchronously, as soon as the value changes.
185+
186+
For both `'pre'` and `'post'`, the callback is buffered using a queue. The callback will only be added to the queue once, even if the watched value changes multiple times. The interim values will be skipped and won't be passed to the callback.
187+
188+
Buffering the callback not only improves performance but also helps to ensure data consistency. The watchers won't be triggered until the code performing the data updates has finished.
189+
190+
`'sync'` watchers should be used sparingly, as they don't have these benefits.
191+
192+
For more information about `flush` see [Effect Flush Timing](../guide/reactivity-computed-watchers.html#effect-flush-timing).
193+
175194
- **See also:** [Watchers](../guide/computed.html#watchers)
176195

177196
## $emit

src/api/instance-properties.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
The root DOM element that the component instance is managing.
3030

31+
For components using [fragments](../guide/migration/fragments), `$el` will be the placeholder DOM node that Vue uses to keep track of the component's position in the DOM. It is recommended to use [template refs](../guide/component-template-refs.html) for direct access to DOM elements instead of relying on `$el`.
32+
3133
## $options
3234

3335
- **Type:** `Object`

src/api/options-api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Options API
2+
3+
The Options API contains the following sections:
4+
5+
- [Data](/api/options-data.html)
6+
- [DOM](/api/options-dom.html)
7+
- [Lifecycle Hooks](/api/options-lifecycle-hooks.html)
8+
- [Assets](/api/options-assets.html)
9+
- [Composition](/api/options-composition.html)
10+
- [Miscellaneous](/api/options-misc.html)

0 commit comments

Comments
 (0)