Skip to content

Commit 39d2905

Browse files
committed
update meta for ts
1 parent d24b068 commit 39d2905

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
# vue-class-component
22

3-
> Experimental ES2016/TypeScript decorator for class-style Vue components.
3+
> ECMAScript / TypeScript decorator for class-style Vue components.
44
55
### Usage
66

7-
Required: Babel with stage 1 transforms (for [decorators](https://github.com/wycats/javascript-decorators/blob/master/README.md)).
7+
**Required**: Babel with stage 1 transforms, or TypeScript 1.5+ (for [decorators](https://github.com/wycats/javascript-decorators/blob/master/README.md)).
88

99
Note:
1010

11-
1. `data`, `el` and all Vue lifecycle hooks can be directly declared as class member methods, but you cannot invoke them on the instance itself. When declaring custom methods, you should avoid these reserved names.
11+
1. `methods` can be declared directly as class member methods.
1212

13-
2. For all other options, pass them to the decorator function.
13+
2. Computed properties can be declared as class property accessors.
14+
15+
3. `data`, `el` and all Vue lifecycle hooks can be directly declared as class member methods as well, but you cannot invoke them on the instance itself. When declaring custom methods, you should avoid these reserved names.
16+
17+
4. For all other options, pass them to the decorator function.
1418

1519
``` js
1620
import Component from 'vue-class-component'
@@ -59,5 +63,3 @@ class App {
5963
``` bash
6064
$ npm install && npm run build
6165
```
62-
63-
Theoretically, this should also work properly as a TypeScript 1.5+ decorator, but I'm not familiar enough with TypeScript to figure out how type checks would come into play. If you'd like to make it work properly with TypeScript, feel free to contribute!

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"version": "3.1.2",
44
"description": "ES201X/TypeScript class decorator for Vue components",
55
"main": "index.js",
6+
"files": [
7+
"index.js",
8+
"index.d.ts",
9+
"tsconfig.json"
10+
],
611
"scripts": {
712
"build": "webpack --config example/webpack.config.js",
813
"dev": "webpack --config example/webpack.config.js --watch",

0 commit comments

Comments
 (0)