UNPKG

vue-di-kit

Version:
50 lines 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var function_1 = require("../function"); var api = require("vue-hot-reload-api"); var V = function_1.getVue(); var HMRClass = /** @class */ (function () { function HMRClass(id, type) { this.id = id; this.type = type; } Object.defineProperty(HMRClass.prototype, "compatible", { get: function () { return api.compatible; }, enumerable: true, configurable: true }); HMRClass.prototype.install = function (vue) { api.install(vue); }; HMRClass.prototype.isRecorded = function (id) { return api.isRecorded(id); }; HMRClass.prototype.createRecord = function (id, type) { api.createRecord(id, type); }; HMRClass.prototype.reload = function (id, type) { api.reload(id, type); }; HMRClass.prototype.hot = function () { if (module.hot) { this.install(V); if (this.compatible) { module.hot.accept(); if (!this.isRecorded(this.id)) { this.createRecord(this.id, this.type); } else { this.reload(this.id, this.type); } } else { console.error('the vue-hot-reload-api is not compatible with this version of Vue'); } } }; return HMRClass; }()); exports.HMRClass = HMRClass; //# sourceMappingURL=hmr.class.js.map