vue-class-component
Advanced tools
Comparing version 7.2.0 to 7.2.1
/** | ||
* vue-class-component v7.2.0 | ||
* vue-class-component v7.2.1 | ||
* (c) 2015-present Evan You | ||
@@ -4,0 +4,0 @@ * @license MIT |
/** | ||
* vue-class-component v7.2.0 | ||
* vue-class-component v7.2.1 | ||
* (c) 2015-present Evan You | ||
@@ -4,0 +4,0 @@ * @license MIT |
/** | ||
* vue-class-component v7.2.0 | ||
* vue-class-component v7.2.1 | ||
* (c) 2015-present Evan You | ||
@@ -4,0 +4,0 @@ * @license MIT |
/** | ||
* vue-class-component v7.2.0 | ||
* vue-class-component v7.2.1 | ||
* (c) 2015-present Evan You | ||
@@ -4,0 +4,0 @@ * @license MIT |
/** | ||
* vue-class-component v7.2.0 | ||
* vue-class-component v7.2.1 | ||
* (c) 2015-present Evan You | ||
@@ -4,0 +4,0 @@ * @license MIT |
/** | ||
* vue-class-component v7.2.0 | ||
* vue-class-component v7.2.1 | ||
* (c) 2015-present Evan You | ||
@@ -4,0 +4,0 @@ * @license MIT |
@@ -1,2 +0,1 @@ | ||
import './lifecycle'; | ||
import Vue, { ComponentOptions } from 'vue'; | ||
@@ -3,0 +2,0 @@ import { VueClass } from './declarations'; |
@@ -1,2 +0,1 @@ | ||
import './lifecycle'; | ||
import { componentFactory, $internalHooks } from './component'; | ||
@@ -3,0 +2,0 @@ export { createDecorator, mixins } from './util'; |
{ | ||
"name": "vue-class-component", | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"description": "ES201X/TypeScript class decorator for Vue components", | ||
@@ -10,3 +10,4 @@ "main": "dist/vue-class-component.common.js", | ||
"dist", | ||
"lib" | ||
"lib", | ||
"hooks.d.ts" | ||
], | ||
@@ -49,2 +50,4 @@ "scripts": { | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^13.1.6", | ||
"@typescript-eslint/parser": "^2.15.0", | ||
"babel-helper-vue-jsx-merge-props": "^2.0.3", | ||
@@ -60,2 +63,3 @@ "babel-loader": "^8.0.6", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.29.0", | ||
"rollup-plugin-babel": "^4.3.3", | ||
@@ -66,3 +70,2 @@ "rollup-plugin-replace": "^2.2.0", | ||
"typescript": "^3.7.4", | ||
"typescript-eslint-parser": "^22.0.0", | ||
"uglify-es": "^3.3.9", | ||
@@ -69,0 +72,0 @@ "vue": "^2.6.11", |
@@ -203,3 +203,17 @@ # vue-class-component | ||
In TypeScript, all built-in lifecycle hools and special methods are declared in the component instance type to enable auto-complete in editors. | ||
### Enabling Custom Hooks Auto-complete in TypeScript | ||
vue-class-component provides a built-in hooks type, which enables auto-complete for `data`, `render` and other lifecycle hooks in class component declarations, for TypeScript. To enable it, you need to import hooks type located at `vue-class-component/hooks`. | ||
```ts | ||
// main.ts | ||
import 'vue-class-component/hooks' // import hooks type to enable auto-complete | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
new Vue({ | ||
render: h => h(App) | ||
}).$mount('#app') | ||
``` | ||
If you want to make it work with custom hooks, you can manually add it by yourself: | ||
@@ -217,3 +231,3 @@ | ||
from: Route, | ||
next: (to?: RawLocation | false | ((vm: V) => any) | void) => void | ||
next: (to?: RawLocation | false | ((vm: Vue) => any) | void) => void | ||
): void | ||
@@ -224,3 +238,3 @@ | ||
from: Route, | ||
next: (to?: RawLocation | false | ((vm: V) => any) | void) => void | ||
next: (to?: RawLocation | false | ((vm: Vue) => any) | void) => void | ||
): void | ||
@@ -231,3 +245,3 @@ | ||
from: Route, | ||
next: (to?: RawLocation | false | ((vm: V) => any) | void) => void | ||
next: (to?: RawLocation | false | ((vm: Vue) => any) | void) => void | ||
): void | ||
@@ -234,0 +248,0 @@ } |
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
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
71694
318
32
22
1372