vue-decorator
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "vue-decorator", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Custom decorators to vue-class-component that fits Vue 3", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.umd.js", |
@@ -31,2 +31,3 @@ # vue-class-decorator | ||
- [`@Watch`](#Watch) | ||
- [`@Ref`](#Ref) | ||
@@ -122,1 +123,28 @@ ### <a id="Prop"></a> `@Prop(options: (PropOptions | VueConstructor[] | VueConstructor) = {})` | ||
### <a id="Ref"></a> `@Ref(refKey?: string)` | ||
```ts | ||
import { Vue, Options, Ref } from 'vue-decorator' | ||
@Options({}) | ||
export default class YourComponent extends Vue { | ||
@Ref('aButton') readonly button!: HTMLButtonElement | ||
} | ||
``` | ||
is equivalent to | ||
```js | ||
export default { | ||
computed() { | ||
button: { | ||
cache: false, | ||
get() { | ||
return this.$refs.aButton as HTMLButtonElement | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
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
7540
149