Socket
Socket
Sign inDemoInstall

vue-class-component

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-class-component - npm Package Compare versions

Comparing version 3.1.2 to 3.2.0

index.d.ts

6

index.js

@@ -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",

14

README.md
# 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!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc