Skip to content

Commit b392106

Browse files
committed
Pushing 0.5 changes
1 parent 83f52bc commit b392106

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,15 @@ var router = new VueRouter();
302302

303303
router.map({
304304
'/' : {
305-
component: new HomeView()
305+
component: HomeView
306306
}
307307
});
308308

309309
router.start(app, '#my-app');
310310
```
311311

312312
#### Note on using `new` with component classes
313-
Calling something like `new MyComponent()` will actually not construct a new component, neither will it re-register it with vue. All components are registered at load time, calling new on the class is equivalent to getting a reference to the return of `Vue.component('my-component', {...})`, this function is only evaluated once, and the retuern is stored internally by vue-typescript. This is why in the vue-router example, we need to put `new` in front of our class.
313+
Calling something like `new MyComponent()` will actually not construct a new MyComponent object, It will actually create a new vue component instance, with the properly formated data, methods, props, watch, etc.. objects. The class MyComponent is actually equivalent to the return of `Vue.component('my-component')`.
314314

315315
# Planned Features
316316
- @on / @once - function decorators to register event handlers

0 commit comments

Comments
 (0)