1 line
13 KiB
Plaintext
1 line
13 KiB
Plaintext
![]() |
{"version":3,"file":"vue-class-component.min.js","sources":["../src/vue-class-component.js"],"sourcesContent":["/* eslint-disable */\n/*eslint no-unused-vars: \"off\" */\n/**\n * vue-class-component v7.2.5\n * (c) 2015-present Evan You\n * @license MIT\n */\nimport Vue from './vue';\n\n // The rational behind the verbose Reflect-feature check below is the fact that there are polyfills\n // which add an implementation for Reflect.defineMetadata but not for Reflect.getOwnMetadataKeys.\n // Without this check consumers will encounter hard to track down runtime errors.\n function reflectionIsSupported() {\n return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys;\n }\n function copyReflectionMetadata(to, from) {\n forwardMetadata(to, from);\n Object.getOwnPropertyNames(from.prototype).forEach(key => {\n forwardMetadata(to.prototype, from.prototype, key);\n });\n Object.getOwnPropertyNames(from).forEach(key => {\n forwardMetadata(to, from, key);\n });\n }\n \n function forwardMetadata(to, from, propertyKey) {\n var metaKeys = propertyKey ? Reflect.getOwnMetadataKeys(from, propertyKey) : Reflect.getOwnMetadataKeys(from);\n metaKeys.forEach(metaKey => {\n var metadata = propertyKey ? Reflect.getOwnMetadata(metaKey, from, propertyKey) : Reflect.getOwnMetadata(metaKey, from);\n \n if (propertyKey) {\n Reflect.defineMetadata(metaKey, metadata, to, propertyKey);\n } else {\n Reflect.defineMetadata(metaKey, metadata, to);\n }\n });\n }\n \n var fakeArray = {\n __proto__: []\n };\n var hasProto = fakeArray instanceof Array;\n function createDecorator(factory) {\n return (target, key, index) => {\n var Ctor = typeof target === 'function' ? target : target.constructor;\n \n if (!Ctor.__decorators__) {\n Ctor.__decorators__ = [];\n }\n \n if (typeof index !== 'number') {\n index = undefined;\n }\n \n Ctor.__decorators__.push(options => factory(options, key, index));\n };\n }\n function mixins() {\n for (var _len = arguments.length, Ctors = new Array(_len), _key = 0; _key < _len; _key++) {\n Ctors[_key] = arguments[_key];\n }\n \n return Vue.extend({\n mixins: Ctors\n });\n }\n function isPrimitive(value) {\n var type = typeof value;\n return value == null || type !== 'object' && type !== 'function';\n }\n function warn(message) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-class-component] ' + message);\n }\n }\n \n function collectDataFromConstructor(vm, Component) {\n // override _init to prevent to init as Vue instance\n var originalInit = Component.prototype._init;\n \n Component.prototype._init = function () {\n // proxy to actual vm\n var keys = Object.getOwnPropertyNames(vm); // 2.2.0 compat (props are no longer exposed as self properties)\n \n if (vm.$options.props) {\n for (var key in vm.$options.props) {\n if (!vm.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n }\n \n keys.forEach(key => {\n Object.defineProperty(this, key, {\n get: () => vm[key],\n set: value => {\n vm[key] = value;\n },\n configurable: true\n });\n });\n }; // should be acquired class property values\n \n \n var data = new Component(); // restore original _init to avoid memory leak (#209)\n \n Component.prototype._init = originalInit; // create plain data object\n \n var plainData = {};\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined) {\n plainData[key] = data[key];\n }\n });\n \n {\n if (!(Component.prototype instanceof Vue) && Object.keys(plainData).length > 0) {\n warn('Component class must inherit Vue or its descendant class ' + 'when class property is used.');\n }\n }\n \n return plainData;\n }\n \n var $internalHooks = ['data', 'beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeDestroy', 'destroyed', 'beforeUpdate', 'updated', 'activated', 'deactivated', 'render', 'errorCaptur
|