Skip to content

Commit 2f47618

Browse files
pull[bot]NataliaTepluhinayulerAlex-Sokolovinquisitivecrystal
authored
[pull] indonesian from master (#31)
* fix: fixed custom directives migration guide * Update the GitHub repo link to `vue-next` (vuejs#672) * Update introduction.md (vuejs#673) * Improve formatting of teleport.md (vuejs#674) This switches a link to using VideoLesson, which should make it look a lot better. It also fixes a small punctuation typo. * Fix a typo (vuejs#675) * Add inject example to reactive section of docs (vuejs#677) This example might come in handy for users that are yet to read on `Computed and Watch` in the documentation so they know that the properties they're making reactive using `computed` is available under `property.value` and not `property`. * Fix: typo in global-api-treeshaking (vuejs#678) * fix: increase header depth and tweak wording in transitions-overview.md (vuejs#679) * fix: add two migration pages to the sidebar index (vuejs#680) * fix: correct two examples of using h with components and slots (vuejs#681) Co-authored-by: NataliaTepluhina <[email protected]> Co-authored-by: YuLe <[email protected]> Co-authored-by: Alexander Sokolov <[email protected]> Co-authored-by: Aris Merchant <[email protected]> Co-authored-by: Kid <[email protected]> Co-authored-by: Timi Omoyeni <[email protected]> Co-authored-by: Kushal Niroula <[email protected]> Co-authored-by: skirtle <[email protected]>
1 parent e5ccde7 commit 2f47618

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

Diff for: src/.vuepress/config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const sidebar = {
126126
'/guide/migration/async-components',
127127
'/guide/migration/attribute-coercion',
128128
'/guide/migration/attrs-includes-class-style',
129+
'/guide/migration/children',
129130
'/guide/migration/custom-directives',
130131
'/guide/migration/custom-elements-interop',
131132
'/guide/migration/data-option',
@@ -148,7 +149,8 @@ const sidebar = {
148149
'/guide/migration/v-on-native-modifier-removed',
149150
'/guide/migration/v-model',
150151
'/guide/migration/v-if-v-for',
151-
'/guide/migration/v-bind'
152+
'/guide/migration/v-bind',
153+
'/guide/migration/watch'
152154
]
153155
},
154156
{

Diff for: src/guide/component-provide-inject.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ app.component('todo-list', {
107107
}
108108
}
109109
})
110+
111+
app.component('todo-list-statistics', {
112+
inject: ['todoLength'],
113+
created() {
114+
console.log(`Injected property: ${this.todoLength.value}`) // > Injected property: 5
115+
}
116+
})
110117
```
111118

112-
In this, any change to `todos.length` will be reflected correctly in the components, where `todoLength` is injected. Read more about `reactive` provide/inject in the [Composition API section](composition-api-provide-inject.html#reactivity)
119+
In this, any change to `todos.length` will be reflected correctly in the components, where `todoLength` is injected. Read more about `computed` in the [Computed and Watch section](reactivity-computed-watchers.html#computed-values) and `reactive` provide/inject in the [Composition API section](composition-api-provide-inject.html#reactivity).

Diff for: src/guide/migration/global-api-treeshaking.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test('an async feature', async () => {
3636

3737
`Vue.nextTick()` is a global API exposed directly on a single Vue object – in fact, the instance method `$nextTick()` is just a handy wrapper around `Vue.nextTick()` with the callback’s `this` context automatically bound to the current instance for convenience.
3838

39-
But what if you’ve never had to deal with manual DOM manipulation, nor are you using or testing async components in our app? Or, what if, for whatever reason, you prefer to use the good old `window.setTimeout()` instead? In such a case, the code for `nextTick()` will become dead code – that is, code that’s written but never used. And dead code is hardly a good thing, especially in our client-side context where every kilobyte matters.
39+
But what if you’ve never had to deal with manual DOM manipulation, nor are you using or testing async components in your app? Or, what if, for whatever reason, you prefer to use the good old `window.setTimeout()` instead? In such a case, the code for `nextTick()` will become dead code – that is, code that’s written but never used. And dead code is hardly a good thing, especially in our client-side context where every kilobyte matters.
4040

4141
Module bundlers like [webpack](https://webpack.js.org/) support [tree-shaking](https://webpack.js.org/guides/tree-shaking/), which is a fancy term for “dead code elimination.” Unfortunately, due to how the code is written in previous Vue versions, global APIs like `Vue.nextTick()` are not tree-shakeable and will be included in the final bundle regardless of where they are actually used or not.
4242

Diff for: src/guide/render-function.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,15 @@ To pass slots to a child component using render functions:
370370
render() {
371371
// `<div><child v-slot="props"><span>{{ props.text }}</span></child></div>`
372372
return Vue.h('div', [
373-
Vue.h('child', {}, {
373+
Vue.h(
374+
Vue.resolveComponent('child'),
375+
{},
374376
// pass `slots` as the children object
375377
// in the form of { name: props => VNode | Array<VNode> }
376-
default: (props) => Vue.h('span', props.text)
377-
})
378+
{
379+
default: (props) => Vue.h('span', props.text)
380+
}
381+
)
378382
])
379383
}
380384
```
@@ -389,7 +393,9 @@ Vue.h(
389393
{
390394
level: 1
391395
},
392-
[Vue.h('span', 'Hello'), ' world!']
396+
{
397+
default: () => [Vue.h('span', 'Hello'), ' world!']
398+
}
393399
)
394400
```
395401

Diff for: src/guide/transitions-overview.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ Vue.createApp(Demo).mount('#demo')
7272

7373
<common-codepen-snippet title="Create animation with a class" slug="ff45b91caf7a98c8c9077ad8ab539260" tab="css,result" :editable="false" :preview="false" />
7474

75-
# Transitions with Style Bindings
75+
## Transitions with Style Bindings
7676

77-
Some transition affects can be applied by interpolating values, for instance by binding a style to an element while an interaction occurs. Take this example for instance:
77+
Some transition effects can be applied by interpolating values, for instance by binding a style to an element while an interaction occurs. Take this example for instance:
7878

7979
```html
8080
<div id="demo">
@@ -152,7 +152,7 @@ You may also find that entrances look better with slightly more time than an exi
152152

153153
## Easing
154154

155-
Easing is an important way to convey depth in an animation. One of the most common mistakes newcomers to animation have is to use `ease-in` for entrances, and `ease-out` for exits. You'll actually need the opposite.
155+
Easing is an important way to convey depth in an animation. One of the most common mistakes newcomers to animation make is to use `ease-in` for entrances, and `ease-out` for exits. You'll actually need the opposite.
156156

157157
If we were to apply these states to a transition, it would look something like this:
158158

0 commit comments

Comments
 (0)