CheckMark.ts 1.48 KB
Newer Older
1
2
// This file is part of BINANA, released under the Apache 2.0 License. See
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
jdurrant's avatar
jdurrant committed
3
// details. Copyright 2021 Jacob D. Durrant.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

declare var Vue;
declare var jQuery;

/** An object containing the vue-component computed functions. */
let computedFunctions = {};

/** An object containing the vue-component methods functions. */
let methodsFunctions = {};

/** An object containing the vue-component watch functions. */
let watchFunctions = {}

/**
 * The vue-component mounted function.
 * @returns void
 */
function mountedFunction(): void {}

/**
 * Setup the check-mark Vue commponent.
 * @returns void
 */
export function setup(): void {
    Vue.component("check-mark", {
        /**
         * Get the data associated with this component.
         * @returns any  The data.
         */
        "data"(): any {
            return {};
        },
        "methods": methodsFunctions,
        "template": /* html */ `
            <span>
                <div class="spacer25px" v-if="value">✔️</div>
                <div class="spacer25px" v-else></div>

                <slot></slot>
                <div class="spacer25px"></div>
            </span>
        `,
        "props": {
            "value": Boolean,
        },
        "computed": computedFunctions,

        /**
         * Runs when the vue component is mounted.
         * @returns void
         */
        "mounted": mountedFunction,

        "watch": watchFunctions
    });
}