1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| import { createDecorator } from 'vue-class-component';
| /**
| * decorator of a ref prop
| * @param refKey the ref key defined in template
| */
| export function Ref(refKey) {
| return createDecorator(function (options, key) {
| options.computed = options.computed || {};
| options.computed[key] = {
| cache: false,
| get: function () {
| return this.$refs[refKey || key];
| },
| };
| });
| }
|
|