Skip to content

Commit 9ca366b

Browse files
committed
[build] 4.4.0
1 parent 1bf9fcc commit 9ca366b

File tree

3 files changed

+252
-0
lines changed

3 files changed

+252
-0
lines changed

dist/vue-class-component.common.js

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/**
2+
* vue-class-component v4.4.0
3+
* (c) 2015-2016 Evan You
4+
* @license MIT
5+
*/
6+
'use strict';
7+
8+
Object.defineProperty(exports, '__esModule', { value: true });
9+
10+
var Vue = require('vue');
11+
12+
function createDecorator(factory) {
13+
return function (_, key, index) {
14+
if (typeof index !== 'number') {
15+
index = undefined;
16+
}
17+
$decoratorQueue.push(function (options) { return factory(options, key, index); });
18+
};
19+
}
20+
function warn(message) {
21+
if (typeof console !== 'undefined') {
22+
console.warn('[vue-class-component] ' + message);
23+
}
24+
}
25+
26+
function collectDataFromConstructor(vm, Component) {
27+
Component.prototype._init = function () {
28+
var _this = this;
29+
Object.getOwnPropertyNames(vm).forEach(function (key) {
30+
Object.defineProperty(_this, key, {
31+
get: function () { return vm[key]; },
32+
set: function (value) { return vm[key] = value; }
33+
});
34+
});
35+
};
36+
var data = new Component();
37+
var plainData = {};
38+
Object.keys(data).forEach(function (key) {
39+
if (data[key] !== undefined) {
40+
plainData[key] = data[key];
41+
}
42+
});
43+
if (process.env.NODE_ENV !== 'production') {
44+
if (!(Component.prototype instanceof Vue) && Object.keys(plainData).length > 0) {
45+
warn('Component class must inherit Vue or its descendant class ' +
46+
'when class property is used.');
47+
}
48+
}
49+
return plainData;
50+
}
51+
52+
var $internalHooks = [
53+
'data',
54+
'beforeCreate',
55+
'created',
56+
'beforeMount',
57+
'mounted',
58+
'beforeDestroy',
59+
'destroyed',
60+
'beforeUpdate',
61+
'updated',
62+
'activated',
63+
'deactivated',
64+
'render'
65+
];
66+
var $decoratorQueue = [];
67+
function componentFactory(Component, options) {
68+
if (options === void 0) { options = {}; }
69+
options.name = options.name || Component._componentTag;
70+
var proto = Component.prototype;
71+
Object.getOwnPropertyNames(proto).forEach(function (key) {
72+
if (key === 'constructor') {
73+
return;
74+
}
75+
if ($internalHooks.indexOf(key) > -1) {
76+
options[key] = proto[key];
77+
return;
78+
}
79+
var descriptor = Object.getOwnPropertyDescriptor(proto, key);
80+
if (typeof descriptor.value === 'function') {
81+
(options.methods || (options.methods = {}))[key] = descriptor.value;
82+
}
83+
else if (descriptor.get || descriptor.set) {
84+
(options.computed || (options.computed = {}))[key] = {
85+
get: descriptor.get,
86+
set: descriptor.set
87+
};
88+
}
89+
});
90+
(options.mixins || (options.mixins = [])).push({
91+
data: function () {
92+
return collectDataFromConstructor(this, Component);
93+
}
94+
});
95+
$decoratorQueue.forEach(function (fn) { return fn(options); });
96+
$decoratorQueue = [];
97+
var superProto = Object.getPrototypeOf(Component.prototype);
98+
var Super = superProto instanceof Vue
99+
? superProto.constructor
100+
: Vue;
101+
return Super.extend(options);
102+
}
103+
104+
function Component(options) {
105+
if (typeof options === 'function') {
106+
return componentFactory(options);
107+
}
108+
return function (Component) {
109+
return componentFactory(Component, options);
110+
};
111+
}
112+
(function (Component) {
113+
function registerHooks(keys) {
114+
$internalHooks.push.apply($internalHooks, keys);
115+
}
116+
Component.registerHooks = registerHooks;
117+
})(Component || (Component = {}));
118+
var Component$1 = Component;
119+
120+
exports['default'] = Component$1;
121+
exports.createDecorator = createDecorator;

dist/vue-class-component.js

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/**
2+
* vue-class-component v4.4.0
3+
* (c) 2015-2016 Evan You
4+
* @license MIT
5+
*/
6+
(function (global, factory) {
7+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
8+
typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
9+
(factory((global.VueClassComponent = global.VueClassComponent || {}),global.Vue));
10+
}(this, (function (exports,Vue) { 'use strict';
11+
12+
function createDecorator(factory) {
13+
return function (_, key, index) {
14+
if (typeof index !== 'number') {
15+
index = undefined;
16+
}
17+
$decoratorQueue.push(function (options) { return factory(options, key, index); });
18+
};
19+
}
20+
function warn(message) {
21+
if (typeof console !== 'undefined') {
22+
console.warn('[vue-class-component] ' + message);
23+
}
24+
}
25+
26+
function collectDataFromConstructor(vm, Component) {
27+
Component.prototype._init = function () {
28+
var _this = this;
29+
Object.getOwnPropertyNames(vm).forEach(function (key) {
30+
Object.defineProperty(_this, key, {
31+
get: function () { return vm[key]; },
32+
set: function (value) { return vm[key] = value; }
33+
});
34+
});
35+
};
36+
var data = new Component();
37+
var plainData = {};
38+
Object.keys(data).forEach(function (key) {
39+
if (data[key] !== undefined) {
40+
plainData[key] = data[key];
41+
}
42+
});
43+
{
44+
if (!(Component.prototype instanceof Vue) && Object.keys(plainData).length > 0) {
45+
warn('Component class must inherit Vue or its descendant class ' +
46+
'when class property is used.');
47+
}
48+
}
49+
return plainData;
50+
}
51+
52+
var $internalHooks = [
53+
'data',
54+
'beforeCreate',
55+
'created',
56+
'beforeMount',
57+
'mounted',
58+
'beforeDestroy',
59+
'destroyed',
60+
'beforeUpdate',
61+
'updated',
62+
'activated',
63+
'deactivated',
64+
'render'
65+
];
66+
var $decoratorQueue = [];
67+
function componentFactory(Component, options) {
68+
if (options === void 0) { options = {}; }
69+
options.name = options.name || Component._componentTag;
70+
var proto = Component.prototype;
71+
Object.getOwnPropertyNames(proto).forEach(function (key) {
72+
if (key === 'constructor') {
73+
return;
74+
}
75+
if ($internalHooks.indexOf(key) > -1) {
76+
options[key] = proto[key];
77+
return;
78+
}
79+
var descriptor = Object.getOwnPropertyDescriptor(proto, key);
80+
if (typeof descriptor.value === 'function') {
81+
(options.methods || (options.methods = {}))[key] = descriptor.value;
82+
}
83+
else if (descriptor.get || descriptor.set) {
84+
(options.computed || (options.computed = {}))[key] = {
85+
get: descriptor.get,
86+
set: descriptor.set
87+
};
88+
}
89+
});
90+
(options.mixins || (options.mixins = [])).push({
91+
data: function () {
92+
return collectDataFromConstructor(this, Component);
93+
}
94+
});
95+
$decoratorQueue.forEach(function (fn) { return fn(options); });
96+
$decoratorQueue = [];
97+
var superProto = Object.getPrototypeOf(Component.prototype);
98+
var Super = superProto instanceof Vue
99+
? superProto.constructor
100+
: Vue;
101+
return Super.extend(options);
102+
}
103+
104+
function Component(options) {
105+
if (typeof options === 'function') {
106+
return componentFactory(options);
107+
}
108+
return function (Component) {
109+
return componentFactory(Component, options);
110+
};
111+
}
112+
(function (Component) {
113+
function registerHooks(keys) {
114+
$internalHooks.push.apply($internalHooks, keys);
115+
}
116+
Component.registerHooks = registerHooks;
117+
})(Component || (Component = {}));
118+
var Component$1 = Component;
119+
120+
exports['default'] = Component$1;
121+
exports.createDecorator = createDecorator;
122+
123+
Object.defineProperty(exports, '__esModule', { value: true });
124+
125+
})));

dist/vue-class-component.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)