3 lines
6.1 KiB
JavaScript
3 lines
6.1 KiB
JavaScript
define("local_treestudyplan/vue-property-decorator",["exports","./vue","./vue-class-component"],(function(_exports,_vue,_vueClassComponent){var obj;function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(_exports,"__esModule",{value:!0}),Object.defineProperty(_exports,"Component",{enumerable:!0,get:function(){return _vueClassComponent.Component}}),_exports.Emit=function(event){return function(_target,propertyKey,descriptor){var key=hyphenate(propertyKey),original=descriptor.value;descriptor.value=function(){for(var _this=this,args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var obj,emit=function(returnValue){var emitName=event||key;void 0===returnValue?0===args.length?_this.$emit(emitName):1===args.length?_this.$emit(emitName,args[0]):_this.$emit.apply(_this,[emitName].concat(args)):0===args.length?_this.$emit(emitName,returnValue):1===args.length?_this.$emit(emitName,returnValue,args[0]):_this.$emit.apply(_this,[emitName,returnValue].concat(args))},returnValue=original.apply(this,args);return(obj=returnValue)instanceof Promise||obj&&"function"==typeof obj.then?returnValue.then(emit):emit(returnValue),returnValue}}},_exports.Inject=function(options){return(0,_vueClassComponent.createDecorator)((function(componentOptions,key){void 0===componentOptions.inject&&(componentOptions.inject={}),Array.isArray(componentOptions.inject)||(componentOptions.inject[key]=options||key)}))},_exports.InjectReactive=function(options){return(0,_vueClassComponent.createDecorator)((function(componentOptions,key){if(void 0===componentOptions.inject&&(componentOptions.inject={}),!Array.isArray(componentOptions.inject)){var fromKey_1=options?options.from||options:key,defaultVal_1=!!options&&options.default||void 0;componentOptions.computed||(componentOptions.computed={}),componentOptions.computed[key]=function(){var obj=this[reactiveInjectKey];return obj?obj[fromKey_1]:defaultVal_1},componentOptions.inject[reactiveInjectKey]=reactiveInjectKey}}))},Object.defineProperty(_exports,"Mixins",{enumerable:!0,get:function(){return _vueClassComponent.mixins}}),_exports.Model=function(event,options){void 0===options&&(options={});return function(target,key){applyMetadata(options,target,key),(0,_vueClassComponent.createDecorator)((function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[k]=options,componentOptions.model={prop:k,event:event||k}}))(target,key)}},_exports.Prop=function(options){void 0===options&&(options={});return function(target,key){applyMetadata(options,target,key),(0,_vueClassComponent.createDecorator)((function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[k]=options}))(target,key)}},_exports.PropSync=function(propName,options){void 0===options&&(options={});return function(target,key){applyMetadata(options,target,key),(0,_vueClassComponent.createDecorator)((function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[propName]=options,(componentOptions.computed||(componentOptions.computed={}))[k]={get:function(){return this[propName]},set:function(value){this.$emit("update:"+propName,value)}}}))(target,key)}},_exports.Provide=function(key){return(0,_vueClassComponent.createDecorator)((function(componentOptions,k){var provide=componentOptions.provide;needToProduceProvide(provide)&&(provide=componentOptions.provide=produceProvide(provide)),provide.managed[k]=key||k}))},_exports.ProvideReactive=function(key){return(0,_vueClassComponent.createDecorator)((function(componentOptions,k){var provide=componentOptions.provide;Array.isArray(componentOptions.inject)||(componentOptions.inject=componentOptions.inject||{},componentOptions.inject[reactiveInjectKey]={from:reactiveInjectKey,default:{}}),needToProduceProvide(provide)&&(provide=componentOptions.provide=produceProvide(provide)),provide.managedReactive[k]=key||k}))},_exports.Ref=function(refKey){return(0,_vueClassComponent.createDecorator)((function(options,key){options.computed=options.computed||{},options.computed[key]={cache:!1,get:function(){return this.$refs[refKey||key]}}}))},Object.defineProperty(_exports,"Vue",{enumerable:!0,get:function(){return _vue.default}}),_exports.Watch=function(path,options){void 0===options&&(options={});var _a=options.deep,deep=void 0!==_a&&_a,_b=options.immediate,immediate=void 0!==_b&&_b;return(0,_vueClassComponent.createDecorator)((function(componentOptions,handler){"object"!==_typeof(componentOptions.watch)&&(componentOptions.watch=Object.create(null));var watch=componentOptions.watch;"object"!==_typeof(watch[path])||Array.isArray(watch[path])?void 0===watch[path]&&(watch[path]=[]):watch[path]=[watch[path]],watch[path].push({handler:handler,deep:deep,immediate:immediate})}))},_vue=(obj=_vue)&&obj.__esModule?obj:{default:obj};var reactiveInjectKey="__reactiveInject__";function produceProvide(original){var provide=function provide(){var _this=this,rv="function"==typeof original?original.call(this):original;for(var i in(rv=Object.create(rv||null))[reactiveInjectKey]=this[reactiveInjectKey]||{},provide.managed)rv[provide.managed[i]]=this[i];var _loop_1=function(i){rv[provide.managedReactive[i]]=this_1[i],Object.defineProperty(rv[reactiveInjectKey],provide.managedReactive[i],{enumerable:!0,get:function(){return _this[i]}})},this_1=this;for(var i in provide.managedReactive)_loop_1(i);return rv};return provide.managed={},provide.managedReactive={},provide}function needToProduceProvide(original){return"function"!=typeof original||!original.managed&&!original.managedReactive}var reflectMetadataIsSupported="undefined"!=typeof Reflect&&void 0!==Reflect.getMetadata;function applyMetadata(options,target,key){if(reflectMetadataIsSupported&&!Array.isArray(options)&&"function"!=typeof options&&void 0===options.type){var type=Reflect.getMetadata("design:type",target,key);type!==Object&&(options.type=type)}}var hyphenateRE=/\B([A-Z])/g,hyphenate=function(str){return str.replace(hyphenateRE,"-$1").toLowerCase()}}));
|
|
|
|
//# sourceMappingURL=vue-property-decorator.min.js.map
|