'use strict';
Object.defineProperty(exports, '__esModule', {
    value: true
});
exports.basic = void 0;
exports.basic = {
    methods: {
        $emit: function (name, detail, options) {
            this.$emit(
                name,
                {
                    detail: detail
                },
                options
            );
        },
        set: function (data) {
            this.setData(data);
            return new Promise(function (resolve) {
                return this.$nextTick(resolve);
            });
        },
        // high performance setData
        setView: function (data, callback) {
            var that = this;
            var target = {};
            var hasChange = false;
            Object.keys(data).forEach(function (key) {
                if (data[key] !== that[key]) {
                    target[key] = data[key];
                    hasChange = true;
                }
            });
            if (hasChange) {
                return this.setData(target, callback);
            }
            return callback && callback();
        }
    }
};
