vue-class-component
Advanced tools
Comparing version 3.1.2 to 3.2.0
@@ -0,1 +1,5 @@ | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}) | ||
var Vue = require('vue') | ||
@@ -63,2 +67,2 @@ | ||
module.exports = decorator | ||
exports.default = decorator |
{ | ||
"name": "vue-class-component", | ||
"version": "3.1.2", | ||
"version": "3.2.0", | ||
"description": "ES201X/TypeScript class decorator for Vue components", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"tsconfig.json" | ||
], | ||
"scripts": { | ||
@@ -7,0 +12,0 @@ "build": "webpack --config example/webpack.config.js", |
# vue-class-component | ||
> Experimental ES2016/TypeScript decorator for class-style Vue components. | ||
> ECMAScript / TypeScript decorator for class-style Vue components. | ||
### Usage | ||
Required: Babel with stage 1 transforms (for [decorators](https://github.com/wycats/javascript-decorators/blob/master/README.md)). | ||
**Required**: Babel with stage 1 transforms, or TypeScript 1.5+ (for [decorators](https://github.com/wycats/javascript-decorators/blob/master/README.md)). | ||
Note: | ||
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. | ||
1. `methods` can be declared directly as class member methods. | ||
2. For all other options, pass them to the decorator function. | ||
2. Computed properties can be declared as class property accessors. | ||
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. | ||
4. For all other options, pass them to the decorator function. | ||
``` js | ||
@@ -62,3 +66,1 @@ import Component from 'vue-class-component' | ||
``` | ||
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! |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66
6502
5
145
1