How to use the nuxt-property-decorator.Vue.nextTick function in nuxt-property-decorator

To help you get started, we’ve selected a few nuxt-property-decorator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phamhongphuc / uit.hotel / uit.hotel.client / components / bootstrap / b-input-date-time.vue View on Github external
async mounted() {
        await Vue.nextTick();
        this.time = moment(this.value).format('HH:mm');
        this.date = moment(this.value).format('YYYY-MM-DD');
        (this.$refs.time as Vue).$emit('input', this.time);
        (this.$refs.date as Vue).$emit('input', this.date);
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / price-volatility / popup-price-volatility-add.vue View on Github external
async onResult() {
        if (this.input === null) return;

        await Vue.nextTick();
        this.input.roomKind.id = this.data.roomKind.id;
        this.$v.$touch();
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / price / popup-price-add.vue View on Github external
async onResult() {
        if (this.input === null) return;

        await Vue.nextTick();
        this.input.roomKind.id = this.data.roomKind.id;
        this.$v.$touch();
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / room / popup-room-update.vue View on Github external
async onResult({
        data,
    }: ApolloQueryResult) {
        if (this.input === null) return;

        await Vue.nextTick();

        if ('roomKinds' in data) {
            this.input.roomKind.id = this.data.room.roomKind.id;
        } else if ('floors' in data) {
            this.input.floor.id = this.data.floor.id;
        }

        this.$v.$touch();
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / employee / popup-employee-update.vue View on Github external
async onResult({
        data: { employee },
    }: ApolloQueryResult) {
        await Vue.nextTick();
        this.employee = employee;
        const {
            id,
            name,
            identityCard,
            phoneNumber,
            address,
            email,
            birthdate,
            gender,
            startingDate,
            position,
        } = employee;
        this.input = {
            id,
            name,
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / room / popup-room-add.vue View on Github external
async onResult({
        data,
    }: ApolloQueryResult) {
        if (this.input === null) return;

        await Vue.nextTick();

        if ('roomKinds' in data) {
            if (data.roomKinds.length === 0) return;

            this.input.roomKind.id = data.roomKinds[0].id;
        } else if ('floors' in data) {
            this.input.floor.id = this.data.floor.id;
        }

        this.$v.$touch();
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / layout / sidebar.vue View on Github external
async mounted() {
        await Vue.nextTick();

        if (this.$route !== undefined) {
            if (this.$route.path.indexOf('/receptionist') === 0) {
                this.showReceptionist = true;
            } else if (this.$route.path.indexOf('/business') === 0) {
                this.showBusiness = true;
            } else if (this.$route.path.indexOf('/manage') === 0) {
                this.showManage = true;
            } else if (this.$route.path.indexOf('/personnel') === 0) {
                this.showPersonnel = true;
            }
        }
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / patron / popup-patron-update.vue View on Github external
async onResult({ data: { patron } }: ApolloQueryResult) {
        await Vue.nextTick();
        this.patron = patron;
        const {
            id,
            identification,
            name,
            email,
            gender,
            nationality,
            birthdate,
            domicile,
            residence,
            company,
            note,
            phoneNumber,
            patronKind,
        } = patron;
github phamhongphuc / uit.hotel / uit.hotel.client / components / popup-context / booking / popup-booking-add-or-update.vue View on Github external
async onResult() {
        if (!this.data.booking) return;
        if (this.input === null) return;
        await Vue.nextTick();
        this.input.room.id = this.data.booking.room.id;
        this.$v.$touch();
    }
}
github phamhongphuc / uit.hotel / uit.hotel.client / components / mixins / popup.ts View on Github external
public async open(data: TData): Promise {
        const popup = this.$refs.popup as Vue & PopupMixin;

        if (popup === undefined || typeof popup.open !== 'function') {
            throw new Error(
                'Không tìm thấy ref=`popup` hoặc hàm `popup.open` trong component',
            );
        }

        this.data = data;
        popup.open(data);

        await this.onOpen();
        await Vue.nextTick();

        const autoFocus = this.$refs.autoFocus as Vue;

        if (autoFocus !== undefined && autoFocus.$refs.input !== undefined) {
            const input = (autoFocus.$refs.input as Vue).$el as HTMLElement;

            if (typeof input.focus === 'function') input.focus();
        }
    }