Skip to content

Commit d0729dd

Browse files
Merge branch 'master' of github.com:vuejs/docs-next
2 parents a1d1183 + 23267df commit d0729dd

File tree

8 files changed

+34
-46
lines changed

8 files changed

+34
-46
lines changed

src/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ module.exports = {
234234
repo: 'vuejs/docs-next',
235235
editLinks: false,
236236
editLinkText: 'Edit this on GitHub!',
237+
lastUpdated: 'Last updated',
237238
docsDir: 'src',
238239
sidebarDepth: 2,
239240
sidebar: {

src/api/global-api.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,9 @@ import { createApp, defineAsyncComponent } from 'vue'
156156
createApp({
157157
// ...
158158
components: {
159-
components: {
160-
AsyncComponent: defineAsyncComponent(() =>
161-
import('./components/AsyncComponent.vue')
162-
)
163-
}
159+
AsyncComponent: defineAsyncComponent(() =>
160+
import('./components/AsyncComponent.vue')
161+
)
164162
}
165163
})
166164
```

src/examples/dynamic-components/index.html

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,19 @@
2626
</div>
2727
</body>
2828
<script>
29-
const app = Vue.createApp()
29+
const app = Vue.createApp({
30+
data() {
31+
return {
32+
currentTab: 'Home',
33+
tabs: ['Home', 'Posts', 'Archive']
34+
}
35+
},
36+
computed: {
37+
currentTabComponent() {
38+
return 'tab-' + this.currentTab.toLowerCase()
39+
}
40+
}
41+
})
3042

3143
app.component('tab-home', {
3244
template: `<div>Home component</div>`
@@ -38,21 +50,6 @@
3850
template: `<div>Archive component</div>`
3951
})
4052

41-
app.mount(
42-
{
43-
data() {
44-
return {
45-
currentTab: 'Home',
46-
tabs: ['Home', 'Posts', 'Archive']
47-
}
48-
},
49-
computed: {
50-
currentTabComponent() {
51-
return 'tab-' + this.currentTab.toLowerCase()
52-
}
53-
}
54-
},
55-
'#dynamic-component-demo'
56-
)
53+
app.mount('#dynamic-component-demo')
5754
</script>
5855
</html>

src/guide/migration/functional-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const DynamicHeading = (props, context) => {
7777

7878
DynamicHeading.props = ['level']
7979

80-
export default GreetingMessage
80+
export default DynamicHeading
8181
```
8282

8383
### Single File Components (SFCs)

src/guide/migration/global-api.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,28 +122,20 @@ app.use(VueRouter)
122122

123123
## Mounting App Instance
124124

125-
After being initialized with `createApp()`, the app instance `app` can be used to mount a Vue root instance with `app.mount(VueInstance, domTarget)`:
125+
After being initialized with `createApp(VueInstance)`, the app instance `app` can be used to mount a Vue root instance with `app.mount(domTarget)`:
126126

127127
```js
128128
import { createApp } from 'vue'
129129
import MyApp from './MyApp.vue'
130130

131-
const app = createApp()
132-
app.mount(MyApp, ‘#app’)
133-
```
134-
135-
The `mount` method can also accept props to be passed to the root component via a third argument:
136-
137-
```js
138-
app.mount(MyApp, '#app', {
139-
// props to be passed to root component
140-
})
131+
const app = createApp(MyApp)
132+
app.mount('#app')
141133
```
142134

143135
With all these changes, the component and directive we have at the beginning of the guide will be rewritten into something like this:
144136

145137
```js
146-
const app = createApp()
138+
const app = createApp(MyApp)
147139

148140
app.component('button-counter', {
149141
data: () => ({
@@ -159,7 +151,7 @@ app.directive('focus', {
159151
// now every Vue instance mounted with app.mount(), along with its
160152
// component tree, will have the same “button-counter” component
161153
// and “focus” directive without polluting the global environment
162-
app.mount(MyApp, '#app')
154+
app.mount('#app')
163155
```
164156

165157
## Provide / Inject
@@ -192,15 +184,15 @@ import { createApp } from 'vue'
192184
import Foo from './Foo.vue'
193185
import Bar from './Bar.vue'
194186

195-
const createMyApp = () => {
196-
const app = createApp({})
187+
const createMyApp = (VueInstance) => {
188+
const app = createApp(VueInstance)
197189
app.directive('focus' /* ... */)
198190

199191
return app
200192
}
201193

202-
createMyApp().mount(Foo, '#foo')
203-
createMyApp().mount(Bar, '#bar')
194+
createMyApp(Foo).mount('#foo')
195+
createMyApp(Bar).mount('#bar')
204196
```
205197

206198
Now the `focus` directive will be available in both Foo and Bar instances and their descendants.

src/guide/migration/render-function-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ In 3.x, the entire VNode props structure is flattened. Using the example from ab
116116
{
117117
class: ['button', 'is-outlined'],
118118
style: { color: '#34495E' },
119-
attrs: { id: 'submit' },
119+
id: 'submit',
120120
innerHTML: '',
121-
on: { click: submitForm },
121+
onClick: submitForm,
122122
key: 'submit-button'
123123
}
124124
```

src/guide/reactivity-fundamentals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can learn more about `reactive` in the [Basic Reactivity API's](../api/basic
2323

2424
## Creating Standalone Reactive Values as `refs`
2525

26-
Imagine the case where we have a standalone primitive value (for example, a string) and we want to make it reactive. Of course, we could make am object with a single property equal to our string, and pass it to `reactive`. Vue has a method that will do the same for us - it's a `ref`:
26+
Imagine the case where we have a standalone primitive value (for example, a string) and we want to make it reactive. Of course, we could make an object with a single property equal to our string, and pass it to `reactive`. Vue has a method that will do the same for us - it's a `ref`:
2727

2828
```js
2929
import { ref } from 'vue'

src/guide/reactivity.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const dinner = {
121121

122122
const handler = {
123123
get(target, prop, receiver) {
124-
track(target, key)
124+
track(target, prop)
125125
return Reflect.get(...arguments)
126126
}
127127
}
@@ -142,7 +142,7 @@ const dinner = {
142142

143143
const handler = {
144144
get(target, prop, receiver) {
145-
track(target, key)
145+
track(target, prop)
146146
return Reflect.get(...arguments)
147147
},
148148
set(target, key, value, receiver) {
@@ -175,7 +175,7 @@ When a nested object is accessed from a reactive proxy, that object is _also_ co
175175
```js
176176
const handler = {
177177
get(target, prop, receiver) {
178-
track(target, key)
178+
track(target, prop)
179179
const value = Reflect.get(...arguments)
180180
if (isObject(value)) {
181181
return reactive(value)

0 commit comments

Comments
 (0)