@vue-async/resource-manager
Version:
Resource Manager.
62 lines • 2.35 kB
JavaScript
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var Suspense_1 = __importStar(require("./ability/Suspense"));
var lazy_1 = __importDefault(require("./ability/lazy"));
var createResource_1 = __importDefault(require("./ability/createResource"));
function install(Vue, options) {
if (options === void 0) { options = {}; }
if (install.installed)
return;
install.installed = true;
Vue.component('Suspense', Suspense_1.default);
var opts = Object.assign({
mode: 'visible',
}, options);
Vue.setSuspenseOptions = function (options) {
Object.assign(opts, options);
};
Vue.lazy = lazy_1.default.bind(null);
Object.defineProperties(Vue.prototype, {
createResource: {
value: createResource_1.default.bind(null),
writable: false,
enumerable: true,
configurable: true,
},
});
Vue.mixin({
created: function () {
if (this.$options.name === Suspense_1.COMPONENT_NAME) {
this.$options.suspense = opts;
}
},
});
}
exports.default = install;
//# sourceMappingURL=install.js.map
;