@vue/composition-api
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -0,1 +1,11 @@ | ||
<a name="0.6.6"></a> | ||
## [0.6.6](https://github.com/vuejs/composition-api/compare/v0.6.5...v0.6.6) (2020-06-21) | ||
### Reverts | ||
* [#387](https://github.com/vuejs/composition-api/issues/387) ([#395](https://github.com/vuejs/composition-api/issues/395)) ([b9fab71](https://github.com/vuejs/composition-api/commit/b9fab71)) | ||
<a name="0.6.5"></a> | ||
@@ -2,0 +12,0 @@ ## [0.6.5](https://github.com/vuejs/composition-api/compare/v0.6.4...v0.6.5) (2020-06-19) |
@@ -818,13 +818,2 @@ 'use strict'; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
if (setup) { | ||
initSetup(vm, vm.$props); | ||
} | ||
var dataValue = typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
return unwrapRefProxy(dataValue); | ||
}; | ||
if (!setup) { | ||
@@ -839,2 +828,10 @@ return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
@@ -841,0 +838,0 @@ function initSetup(vm, props) { |
@@ -15,2 +15,2 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("vue"))&&"object"==typeof e&&"default"in e?e.default:e;function n(e){return"function"==typeof e&&/native code/.test(e.toString())}var r="undefined"!=typeof Symbol&&n(Symbol)&&"undefined"!=typeof Reflect&&n(Reflect.ownKeys),o=function(e){return e},i={enumerable:!0,configurable:!0,get:o,set:o};function u(e,t,n){var r=n.get,u=n.set;i.get=r||o,i.set=u||o,Object.defineProperty(e,t,i)}function f(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function a(e,t){return Object.hasOwnProperty.call(e,t)}function c(e){return Array.isArray(e)}function s(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function l(e){return"function"==typeof e}function v(e,n){t.util.warn(e,n)}var p=null,d=null;function y(){return p}function b(){return d}function g(e){d=e} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(x(arguments[t]));return e}function w(e){return b()}function O(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function j(e){return p&&e instanceof p}function $(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.$scopedSlots[t]?e.$scopedSlots[t].apply(e,n):v("slots."+t+'() got called outside of the "render()" scope',e)}}function k(e){return r?Symbol.for(e):e}var E=k("vfa.key.preFlushQueue"),S=k("vfa.key.postFlushQueue"),R=k("vfa.key.accessControlIdentifier"),P=k("vfa.key.reactiveIdentifier"),A=k("vfa.key.rawIdentifierKey"),C="vfa.key.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function U(e){return Object.seal(new M(e))}function I(e){var t;if(B(e))return e;var n=G(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})}function B(e){return e instanceof M}function z(e,t){var n=e[t];return B(n)?n:U({get:function(){return e[t]},set:function(n){return e[t]=n}})}var D={},F={},K={};function V(e){return a(e,A)&&e[A]===K}function Q(e){return Object.isExtensible(e)&&a(e,P)&&e[P]===F}function T(e){if(!(!s(e)||V(e)||Array.isArray(e)||B(e)||j(e)||a(e,R)&&e[R]===D)){Object.isExtensible(e)&&f(e,R,D);for(var t=Object.keys(e),n=0;n<t.length;n++)q(e,t[n])}}function q(e,t,n){if("__ob__"!==t){var r,o,i=Object.getOwnPropertyDescriptor(e,t);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=e[t])}T(n),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):n;return t!==C&&B(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):n;t!==C&&B(u)&&!B(i)?u.value=i:o?o.call(e,i):n=i,T(i)}}})}}function J(e){var t,n=y();n.observable?t=n.observable(e):t=O(n,{data:{$$state:e}})._data.$$state;return t}function N(e){var t,n;if(!s(e)||Q(e)||V(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),T(r);var o=r.__ob__,i=function(t){var n,i,f=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable)return"continue";n=a.get,i=a.set,n&&!i||2!==u.length||(f=e[t])}Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){var t=n?n.call(e):f;return o.dep.depend(),t},set:function(t){n&&!i||(i?i.call(e,t):f=t,o.dep.notify())}})},u=arguments;try{for(var f=_(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return r}function W(e,t){if(void 0===t&&(t=!1),!(!s(e)||V(e)||Array.isArray(e)||B(e)||j(e)||a(e,P)&&e[P]===F||(Object.isExtensible(e)&&f(e,P,F),t)))for(var n=Object.keys(e),r=0;r<n.length;r++)W(e[n[r]])}function G(e){if(!s(e)||Q(e)||V(e)||!Object.isExtensible(e))return e;var t=J(e);return W(e),T(t),t}function H(e){return s(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,A,K),e):e}function L(e,t){p&&p===e||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return function e(t,n){if(!t)return n;if(!n)return t;for(var o,i,u,f=r?Reflect.ownKeys(t):Object.keys(t),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=n[o],u=t[o],a(n,o)?i!==u&&s(i)&&!B(i)&&s(u)&&!B(u)&&e(u,i):n[o]=u);return n}("function"==typeof e?e(n,o)||{}:void 0,"function"==typeof t?t(n,o)||{}:void 0)}},p=e,t(e))}var X,Y={set:function(e,t,n){(e.__secret_vfa_state__=e.__secret_vfa_state__||{})[t]=n},get:function(e,t){return(e.__secret_vfa_state__||{})[t]}};function Z(e,t){var n,r;if(void 0===t&&(t=new WeakMap),t.has(e))return t.get(e);if(l(e)||c(e)||Q(e)||!s(e)||!Object.isExtensible(e)||B(e)||V(e))return e;var o={};t.set(e,o),Object.getOwnPropertySymbols(e).forEach((function(t){return o[t]=e[t]}));var i=function(n){var r=e[n];if(!r||V(r))o[n]=r;else if(B(r)){u(o,n,{get:function(){return r.value},set:function(e){return r.value=e}})}else o[n]=Z(r,t)};try{for(var f=_(Object.keys(e)),a=f.next();!a.done;a=f.next()){i(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return o}function ee(e){var t=Y.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,r=Y.get(e,"refs")||[],o=0;o<r.length;o++){var i=t[a=r[o]];!n[a]&&i&&B(i)&&(i.value=null)}var u=Object.keys(n),f=[];for(o=0;o<u.length;o++){var a;i=t[a=u[o]];n[a]&&i&&B(i)&&(i.value=n[a],f.push(a))}Y.set(e,"refs",f)}}function te(e,t){var n=e.$options._parentVnode;if(n){for(var r=Y.get(e,"slots")||[],o=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var r in n={},e)e[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in t)r in n||(n[r]=!0);return n}(n.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete t[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;t[f=u[i]]||(t[f]=$(e,f))}Y.set(e,"slots",u)}}function ne(e,t,n){var r=b();g(e);try{return t(e)}catch(e){if(!n)throw e;n(e)}finally{g(r)}}function re(e){e.mixin({beforeCreate:function(){var e=this,t=e.$options,n=t.setup,r=t.render;r&&(t.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return ne(e,(function(){return r.apply(t,n)}))});var o=t.data;if(t.data=function(){return n&&function(e,t){void 0===t&&(t={});var n,r=e.$options.setup,o=function(e){var t={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(n){var r,o,i;Array.isArray(n)?(r=x(n,2),o=r[0],i=r[1]):o=i=n,i="$"+i,u(t,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(n){var r="$"+n;u(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e[r];o.apply(e,t)}}})})),t}(e);if(W(t),te(e,o.slots),ne(e,(function(){n=r(t,o)})),!n)return;if(l(n)){var i=n;return void(e.$options.render=function(){return te(e,o.slots),ne(e,(function(){return i()}))})}if(s(n)){var f=n;Y.set(e,"rawBindings",n),Object.keys(n).forEach((function(t){var n=f[t];B(n)||(Q(n)?n=I(n):(l(n)&&(n=n.bind(e)),n=I(H(Z(n))))),function(e,t,n){var r=e.$options.props;t in e||r&&a(r,t)||u(e,t,{get:function(){return n.value},set:function(e){n.value=e}})}(e,t,n)}))}}(e,e.$props),Z("function"==typeof o?o.call(e,e):o||{})},!n)return;if("function"!=typeof n)return},mounted:function(){ee(this)},updated:function(){ee(this)}})}function oe(e){return e}function ie(e){return function(t){var n,r=w(((n=e)[0].toUpperCase(),n.slice(1)));r&&function(e,t,n,r){var o=t.$options,i=e.config.optionMergeStrategies[n];o[n]=i(o[n],function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=b();g(e);try{return t.apply(void 0,m(n))}finally{g(o)}}}(t,r))}(y(),r,e,t)}}var ue,fe=ie("beforeMount"),ae=ie("mounted"),ce=ie("beforeUpdate"),se=ie("updated"),le=ie("beforeDestroy"),ve=ie("destroyed"),pe=ie("errorCaptured"),de=ie("activated"),ye=ie("deactivated"),be=ie("serverPrefetch");function ge(){xe(this,E)}function he(){xe(this,S)}function _e(){var e=b();return e?function(e){return void 0!==e[E]}(e)||function(e){e[E]=[],e[S]=[],e.$on("hook:beforeUpdate",ge),e.$on("hook:updated",he)}(e):(ue||(ue=O(y())),e=ue),e}function xe(e,t){for(var n=e[t],r=0;r<n.length;r++)n[r]();n.length=0}function me(e,t,n){var r=function(){e.$nextTick((function(){e[E].length&&xe(e,E),e[S].length&&xe(e,S)}))};switch(n){case"pre":r(),e[E].push(t);break;case"post":r(),e[S].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] "+t)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+n)}}function we(e,t){var n=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(e,r),t()}}function Oe(e,t,n,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,t,n){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},s=function(t){return f||e===ue?t:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return me(e,(function(){t.apply(void 0,m(n))}),u)}};if(null===n){var p=!1,d=function(e,t,n,r){var o=e._watchers.length;return e.$watch(t,n,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!p)try{p=!0,t(a)}finally{p=!1}}),o,{deep:r.deep||!1,sync:f,before:c});we(d,c),d.lazy=!1;var y=d.get.bind(d);return d.get=s(y),function(){d.teardown()}}var b,g=r.deep;Array.isArray(t)?b=function(){return t.map((function(e){return B(e)?e.value:e()}))}:B(t)?b=function(){return t.value}:Q(t)?(b=function(){return t},g=!0):l(t)?b=t:(b=o,v("Invalid watch source: "+JSON.stringify(t)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var h=function(e,t){c(),n(e,t,a)},_=s(h);if(r.immediate){var x=_,w=function(e,t){w=x,h(e,t)};_=function(e,t){w(e,t)}}var O=e.$watch(b,_,{immediate:r.immediate,deep:g,sync:f});return we(e._watchers[e._watchers.length-1],c),function(){O()}}var je={};var $e=function(e){return L(e,re)},ke={install:$e};p&&"undefined"!=typeof window&&window.Vue&&$e(window.Vue),exports.computed=function(e){var t,n,r=b();"function"==typeof e?t=e:(t=e.get,n=e.set);var o=O(y(),{computed:{$$state:{get:t,set:n}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),U({get:function(){return o.$$state},set:function(e){o.$$state=e}})},exports.createComponent=function(e){return e},exports.createElement=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d?d.$createElement.apply(d,e):(v("`createElement()` has been called outside of render function."),X||(X=O(y()).$createElement),X.apply(X,e))},exports.default=ke,exports.defineComponent=oe,exports.getCurrentInstance=b,exports.inject=function(e,t){if(!e)return t;var n=b();if(n){var r=function(e,t){for(var n=t;n;){if(n._provided&&a(n._provided,e))return n._provided[e];n=n.$parent}return je}(e,n);return r!==je?r:t}v("inject() can only be used inside setup() or functional components.")},exports.isReactive=Q,exports.isRef=B,exports.markRaw=H,exports.onActivated=de,exports.onBeforeMount=fe,exports.onBeforeUnmount=le,exports.onBeforeUpdate=ce,exports.onDeactivated=ye,exports.onErrorCaptured=pe,exports.onMounted=ae,exports.onServerPrefetch=be,exports.onUnmounted=ve,exports.onUpdated=se,exports.provide=function(e,t){var n=w();if(n){if(!n._provided){var r={};Object.defineProperty(n,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}n._provided[e]=t}},exports.reactive=G,exports.ref=I,exports.set=function(e,t,n){var r=y().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var i=e.__ob__;return e._isVue||i&&i.vmCount?n:i?(o(i.value,t,n),q(e,t,n),W(i.value[t]),i.dep.notify(),n):(e[t]=n,n)},exports.shallowReactive=N,exports.shallowRef=function(e){var t;if(B(e))return e;var n=N(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})},exports.toRaw=function(e){return V(J)||!Object.isExtensible(e)?e:e.__ob__.value||e},exports.toRef=z,exports.toRefs=function(e){if(!s(e))return e;var t={};for(var n in e)t[n]=z(e,n);return t},exports.triggerRef=function(e){B(e)&&(e.value=e.value)},exports.unref=function(e){return B(e)?e.value:e},exports.watch=function(e,t,n){var r=null;"function"==typeof t?r=t:(n=t,r=null);var o=function(e){return h({immediate:!1,deep:!1,flush:"post"},e)}(n);return Oe(_e(),e,r,o)},exports.watchEffect=function(e,t){var n=function(e){return h({immediate:!0,deep:!1,flush:"post"},e)}(t);return Oe(_e(),e,null,n)}; | ||
***************************************************************************** */var h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(x(arguments[t]));return e}function w(e){return b()}function O(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function j(e){return p&&e instanceof p}function $(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.$scopedSlots[t]?e.$scopedSlots[t].apply(e,n):v("slots."+t+'() got called outside of the "render()" scope',e)}}function k(e){return r?Symbol.for(e):e}var E=k("vfa.key.preFlushQueue"),S=k("vfa.key.postFlushQueue"),R=k("vfa.key.accessControlIdentifier"),P=k("vfa.key.reactiveIdentifier"),A=k("vfa.key.rawIdentifierKey"),C="vfa.key.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function U(e){return Object.seal(new M(e))}function I(e){var t;if(B(e))return e;var n=G(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})}function B(e){return e instanceof M}function z(e,t){var n=e[t];return B(n)?n:U({get:function(){return e[t]},set:function(n){return e[t]=n}})}var D={},F={},K={};function V(e){return a(e,A)&&e[A]===K}function Q(e){return Object.isExtensible(e)&&a(e,P)&&e[P]===F}function T(e){if(!(!s(e)||V(e)||Array.isArray(e)||B(e)||j(e)||a(e,R)&&e[R]===D)){Object.isExtensible(e)&&f(e,R,D);for(var t=Object.keys(e),n=0;n<t.length;n++)q(e,t[n])}}function q(e,t,n){if("__ob__"!==t){var r,o,i=Object.getOwnPropertyDescriptor(e,t);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=e[t])}T(n),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):n;return t!==C&&B(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):n;t!==C&&B(u)&&!B(i)?u.value=i:o?o.call(e,i):n=i,T(i)}}})}}function J(e){var t,n=y();n.observable?t=n.observable(e):t=O(n,{data:{$$state:e}})._data.$$state;return t}function N(e){var t,n;if(!s(e)||Q(e)||V(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),T(r);var o=r.__ob__,i=function(t){var n,i,f=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable)return"continue";n=a.get,i=a.set,n&&!i||2!==u.length||(f=e[t])}Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){var t=n?n.call(e):f;return o.dep.depend(),t},set:function(t){n&&!i||(i?i.call(e,t):f=t,o.dep.notify())}})},u=arguments;try{for(var f=_(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return r}function W(e,t){if(void 0===t&&(t=!1),!(!s(e)||V(e)||Array.isArray(e)||B(e)||j(e)||a(e,P)&&e[P]===F||(Object.isExtensible(e)&&f(e,P,F),t)))for(var n=Object.keys(e),r=0;r<n.length;r++)W(e[n[r]])}function G(e){if(!s(e)||Q(e)||V(e)||!Object.isExtensible(e))return e;var t=J(e);return W(e),T(t),t}function H(e){return s(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,A,K),e):e}function L(e,t){p&&p===e||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return function e(t,n){if(!t)return n;if(!n)return t;for(var o,i,u,f=r?Reflect.ownKeys(t):Object.keys(t),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=n[o],u=t[o],a(n,o)?i!==u&&s(i)&&!B(i)&&s(u)&&!B(u)&&e(u,i):n[o]=u);return n}("function"==typeof e?e(n,o)||{}:void 0,"function"==typeof t?t(n,o)||{}:void 0)}},p=e,t(e))}var X,Y={set:function(e,t,n){(e.__secret_vfa_state__=e.__secret_vfa_state__||{})[t]=n},get:function(e,t){return(e.__secret_vfa_state__||{})[t]}};function Z(e){var t=Y.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,r=Y.get(e,"refs")||[],o=0;o<r.length;o++){var i=t[a=r[o]];!n[a]&&i&&B(i)&&(i.value=null)}var u=Object.keys(n),f=[];for(o=0;o<u.length;o++){var a;i=t[a=u[o]];n[a]&&i&&B(i)&&(i.value=n[a],f.push(a))}Y.set(e,"refs",f)}}function ee(e,t){var n=e.$options._parentVnode;if(n){for(var r=Y.get(e,"slots")||[],o=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var r in n={},e)e[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in t)r in n||(n[r]=!0);return n}(n.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete t[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;t[f=u[i]]||(t[f]=$(e,f))}Y.set(e,"slots",u)}}function te(e,t,n){var r=b();g(e);try{return t(e)}catch(e){if(!n)throw e;n(e)}finally{g(r)}}function ne(e){e.mixin({beforeCreate:function(){var e=this,t=e.$options,n=t.setup,r=t.render;r&&(t.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return te(e,(function(){return r.apply(t,n)}))});if(!n)return;if("function"!=typeof n)return;var o=t.data;t.data=function(){return function(e,t){void 0===t&&(t={});var n,r=e.$options.setup,o=function(e){var t={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(n){var r,o,i;Array.isArray(n)?(r=x(n,2),o=r[0],i=r[1]):o=i=n,i="$"+i,u(t,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(n){var r="$"+n;u(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e[r];o.apply(e,t)}}})})),t}(e);if(W(t),ee(e,o.slots),te(e,(function(){n=r(t,o)})),!n)return;if(l(n)){var i=n;return void(e.$options.render=function(){return ee(e,o.slots),te(e,(function(){return i()}))})}if(s(n)){var f=n;Y.set(e,"rawBindings",n),Object.keys(n).forEach((function(t){var n=f[t];B(n)||(Q(n)?n=I(n):(l(n)&&(n=n.bind(e)),n=I(H(function e(t,n){var r,o;if(void 0===n&&(n=new WeakMap),n.has(t))return n.get(t);if(l(t)||c(t)||Q(t)||!s(t)||!Object.isExtensible(t)||B(t)||V(t))return t;var i={};n.set(t,i),Object.getOwnPropertySymbols(t).forEach((function(e){return i[e]=t[e]}));var f=function(r){var o=t[r];if(!o||V(o))i[r]=o;else if(B(o)){u(i,r,{get:function(){return o.value},set:function(e){return o.value=e}})}else i[r]=e(o,n)};try{for(var a=_(Object.keys(t)),v=a.next();!v.done;v=a.next()){f(v.value)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(n))))),function(e,t,n){var r=e.$options.props;t in e||r&&a(r,t)||u(e,t,{get:function(){return n.value},set:function(e){n.value=e}})}(e,t,n)}))}}(e,e.$props),"function"==typeof o?o.call(e,e):o||{}}},mounted:function(){Z(this)},updated:function(){Z(this)}})}function re(e){return e}function oe(e){return function(t){var n,r=w(((n=e)[0].toUpperCase(),n.slice(1)));r&&function(e,t,n,r){var o=t.$options,i=e.config.optionMergeStrategies[n];o[n]=i(o[n],function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=b();g(e);try{return t.apply(void 0,m(n))}finally{g(o)}}}(t,r))}(y(),r,e,t)}}var ie,ue=oe("beforeMount"),fe=oe("mounted"),ae=oe("beforeUpdate"),ce=oe("updated"),se=oe("beforeDestroy"),le=oe("destroyed"),ve=oe("errorCaptured"),pe=oe("activated"),de=oe("deactivated"),ye=oe("serverPrefetch");function be(){_e(this,E)}function ge(){_e(this,S)}function he(){var e=b();return e?function(e){return void 0!==e[E]}(e)||function(e){e[E]=[],e[S]=[],e.$on("hook:beforeUpdate",be),e.$on("hook:updated",ge)}(e):(ie||(ie=O(y())),e=ie),e}function _e(e,t){for(var n=e[t],r=0;r<n.length;r++)n[r]();n.length=0}function xe(e,t,n){var r=function(){e.$nextTick((function(){e[E].length&&_e(e,E),e[S].length&&_e(e,S)}))};switch(n){case"pre":r(),e[E].push(t);break;case"post":r(),e[S].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] "+t)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+n)}}function me(e,t){var n=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(e,r),t()}}function we(e,t,n,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,t,n){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},s=function(t){return f||e===ie?t:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return xe(e,(function(){t.apply(void 0,m(n))}),u)}};if(null===n){var p=!1,d=function(e,t,n,r){var o=e._watchers.length;return e.$watch(t,n,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!p)try{p=!0,t(a)}finally{p=!1}}),o,{deep:r.deep||!1,sync:f,before:c});me(d,c),d.lazy=!1;var y=d.get.bind(d);return d.get=s(y),function(){d.teardown()}}var b,g=r.deep;Array.isArray(t)?b=function(){return t.map((function(e){return B(e)?e.value:e()}))}:B(t)?b=function(){return t.value}:Q(t)?(b=function(){return t},g=!0):l(t)?b=t:(b=o,v("Invalid watch source: "+JSON.stringify(t)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var h=function(e,t){c(),n(e,t,a)},_=s(h);if(r.immediate){var x=_,w=function(e,t){w=x,h(e,t)};_=function(e,t){w(e,t)}}var O=e.$watch(b,_,{immediate:r.immediate,deep:g,sync:f});return me(e._watchers[e._watchers.length-1],c),function(){O()}}var Oe={};var je=function(e){return L(e,ne)},$e={install:je};p&&"undefined"!=typeof window&&window.Vue&&je(window.Vue),exports.computed=function(e){var t,n,r=b();"function"==typeof e?t=e:(t=e.get,n=e.set);var o=O(y(),{computed:{$$state:{get:t,set:n}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),U({get:function(){return o.$$state},set:function(e){o.$$state=e}})},exports.createComponent=function(e){return e},exports.createElement=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d?d.$createElement.apply(d,e):(v("`createElement()` has been called outside of render function."),X||(X=O(y()).$createElement),X.apply(X,e))},exports.default=$e,exports.defineComponent=re,exports.getCurrentInstance=b,exports.inject=function(e,t){if(!e)return t;var n=b();if(n){var r=function(e,t){for(var n=t;n;){if(n._provided&&a(n._provided,e))return n._provided[e];n=n.$parent}return Oe}(e,n);return r!==Oe?r:t}v("inject() can only be used inside setup() or functional components.")},exports.isReactive=Q,exports.isRef=B,exports.markRaw=H,exports.onActivated=pe,exports.onBeforeMount=ue,exports.onBeforeUnmount=se,exports.onBeforeUpdate=ae,exports.onDeactivated=de,exports.onErrorCaptured=ve,exports.onMounted=fe,exports.onServerPrefetch=ye,exports.onUnmounted=le,exports.onUpdated=ce,exports.provide=function(e,t){var n=w();if(n){if(!n._provided){var r={};Object.defineProperty(n,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}n._provided[e]=t}},exports.reactive=G,exports.ref=I,exports.set=function(e,t,n){var r=y().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var i=e.__ob__;return e._isVue||i&&i.vmCount?n:i?(o(i.value,t,n),q(e,t,n),W(i.value[t]),i.dep.notify(),n):(e[t]=n,n)},exports.shallowReactive=N,exports.shallowRef=function(e){var t;if(B(e))return e;var n=N(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})},exports.toRaw=function(e){return V(J)||!Object.isExtensible(e)?e:e.__ob__.value||e},exports.toRef=z,exports.toRefs=function(e){if(!s(e))return e;var t={};for(var n in e)t[n]=z(e,n);return t},exports.triggerRef=function(e){B(e)&&(e.value=e.value)},exports.unref=function(e){return B(e)?e.value:e},exports.watch=function(e,t,n){var r=null;"function"==typeof t?r=t:(n=t,r=null);var o=function(e){return h({immediate:!1,deep:!1,flush:"post"},e)}(n);return we(he(),e,r,o)},exports.watchEffect=function(e,t){var n=function(e){return h({immediate:!0,deep:!1,flush:"post"},e)}(t);return we(he(),e,null,n)}; |
@@ -812,13 +812,2 @@ import Vue from 'vue'; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
if (setup) { | ||
initSetup(vm, vm.$props); | ||
} | ||
var dataValue = typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
return unwrapRefProxy(dataValue); | ||
}; | ||
if (!setup) { | ||
@@ -833,2 +822,10 @@ return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
@@ -835,0 +832,0 @@ function initSetup(vm, props) { |
@@ -818,13 +818,2 @@ (function (global, factory) { | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
if (setup) { | ||
initSetup(vm, vm.$props); | ||
} | ||
var dataValue = typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
return unwrapRefProxy(dataValue); | ||
}; | ||
if (!setup) { | ||
@@ -839,2 +828,10 @@ return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
@@ -841,0 +838,0 @@ function initSetup(vm, props) { |
@@ -15,2 +15,2 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).vueCompositionApi={},e.Vue)}(this,(function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;function n(e){return"function"==typeof e&&/native code/.test(e.toString())}var r="undefined"!=typeof Symbol&&n(Symbol)&&"undefined"!=typeof Reflect&&n(Reflect.ownKeys),o=function(e){return e},i={enumerable:!0,configurable:!0,get:o,set:o};function u(e,t,n){var r=n.get,u=n.set;i.get=r||o,i.set=u||o,Object.defineProperty(e,t,i)}function f(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function a(e,t){return Object.hasOwnProperty.call(e,t)}function c(e){return Array.isArray(e)}function l(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function s(e){return"function"==typeof e}function v(e,n){t.util.warn(e,n)}var d=null,p=null;function y(){return d}function b(){return p}function h(e){p=e} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function O(e){return b()}function j(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function $(e){return d&&e instanceof d}function k(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.$scopedSlots[t]?e.$scopedSlots[t].apply(e,n):v("slots."+t+'() got called outside of the "render()" scope',e)}}function x(e){return r?Symbol.for(e):e}var E=x("vfa.key.preFlushQueue"),S=x("vfa.key.postFlushQueue"),P=x("vfa.key.accessControlIdentifier"),R=x("vfa.key.reactiveIdentifier"),A=x("vfa.key.rawIdentifierKey"),C="vfa.key.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function U(e){return Object.seal(new M(e))}function I(e){var t;if(B(e))return e;var n=G(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})}function B(e){return e instanceof M}function V(e,t){var n=e[t];return B(n)?n:U({get:function(){return e[t]},set:function(n){return e[t]=n}})}var z={},D={},F={};function K(e){return a(e,A)&&e[A]===F}function Q(e){return Object.isExtensible(e)&&a(e,R)&&e[R]===D}function T(e){if(!(!l(e)||K(e)||Array.isArray(e)||B(e)||$(e)||a(e,P)&&e[P]===z)){Object.isExtensible(e)&&f(e,P,z);for(var t=Object.keys(e),n=0;n<t.length;n++)q(e,t[n])}}function q(e,t,n){if("__ob__"!==t){var r,o,i=Object.getOwnPropertyDescriptor(e,t);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=e[t])}T(n),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):n;return t!==C&&B(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):n;t!==C&&B(u)&&!B(i)?u.value=i:o?o.call(e,i):n=i,T(i)}}})}}function J(e){var t,n=y();n.observable?t=n.observable(e):t=j(n,{data:{$$state:e}})._data.$$state;return t}function N(e){var t,n;if(!l(e)||Q(e)||K(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),T(r);var o=r.__ob__,i=function(t){var n,i,f=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable)return"continue";n=a.get,i=a.set,n&&!i||2!==u.length||(f=e[t])}Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){var t=n?n.call(e):f;return o.dep.depend(),t},set:function(t){n&&!i||(i?i.call(e,t):f=t,o.dep.notify())}})},u=arguments;try{for(var f=_(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return r}function W(e,t){if(void 0===t&&(t=!1),!(!l(e)||K(e)||Array.isArray(e)||B(e)||$(e)||a(e,R)&&e[R]===D||(Object.isExtensible(e)&&f(e,R,D),t)))for(var n=Object.keys(e),r=0;r<n.length;r++)W(e[n[r]])}function G(e){if(!l(e)||Q(e)||K(e)||!Object.isExtensible(e))return e;var t=J(e);return W(e),T(t),t}function H(e){return l(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,A,F),e):e}function L(e,t){d&&d===e||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return function e(t,n){if(!t)return n;if(!n)return t;for(var o,i,u,f=r?Reflect.ownKeys(t):Object.keys(t),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=n[o],u=t[o],a(n,o)?i!==u&&l(i)&&!B(i)&&l(u)&&!B(u)&&e(u,i):n[o]=u);return n}("function"==typeof e?e(n,o)||{}:void 0,"function"==typeof t?t(n,o)||{}:void 0)}},d=e,t(e))}var X,Y={set:function(e,t,n){(e.__secret_vfa_state__=e.__secret_vfa_state__||{})[t]=n},get:function(e,t){return(e.__secret_vfa_state__||{})[t]}};function Z(e,t){var n,r;if(void 0===t&&(t=new WeakMap),t.has(e))return t.get(e);if(s(e)||c(e)||Q(e)||!l(e)||!Object.isExtensible(e)||B(e)||K(e))return e;var o={};t.set(e,o),Object.getOwnPropertySymbols(e).forEach((function(t){return o[t]=e[t]}));var i=function(n){var r=e[n];if(!r||K(r))o[n]=r;else if(B(r)){u(o,n,{get:function(){return r.value},set:function(e){return r.value=e}})}else o[n]=Z(r,t)};try{for(var f=_(Object.keys(e)),a=f.next();!a.done;a=f.next()){i(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return o}function ee(e){var t=Y.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,r=Y.get(e,"refs")||[],o=0;o<r.length;o++){var i=t[a=r[o]];!n[a]&&i&&B(i)&&(i.value=null)}var u=Object.keys(n),f=[];for(o=0;o<u.length;o++){var a;i=t[a=u[o]];n[a]&&i&&B(i)&&(i.value=n[a],f.push(a))}Y.set(e,"refs",f)}}function te(e,t){var n=e.$options._parentVnode;if(n){for(var r=Y.get(e,"slots")||[],o=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var r in n={},e)e[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in t)r in n||(n[r]=!0);return n}(n.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete t[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;t[f=u[i]]||(t[f]=k(e,f))}Y.set(e,"slots",u)}}function ne(e,t,n){var r=b();h(e);try{return t(e)}catch(e){if(!n)throw e;n(e)}finally{h(r)}}function re(e){e.mixin({beforeCreate:function(){var e=this,t=e.$options,n=t.setup,r=t.render;r&&(t.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return ne(e,(function(){return r.apply(t,n)}))});var o=t.data;if(t.data=function(){return n&&function(e,t){void 0===t&&(t={});var n,r=e.$options.setup,o=function(e){var t={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(n){var r,o,i;Array.isArray(n)?(r=m(n,2),o=r[0],i=r[1]):o=i=n,i="$"+i,u(t,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(n){var r="$"+n;u(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e[r];o.apply(e,t)}}})})),t}(e);if(W(t),te(e,o.slots),ne(e,(function(){n=r(t,o)})),!n)return;if(s(n)){var i=n;return void(e.$options.render=function(){return te(e,o.slots),ne(e,(function(){return i()}))})}if(l(n)){var f=n;Y.set(e,"rawBindings",n),Object.keys(n).forEach((function(t){var n=f[t];B(n)||(Q(n)?n=I(n):(s(n)&&(n=n.bind(e)),n=I(H(Z(n))))),function(e,t,n){var r=e.$options.props;t in e||r&&a(r,t)||u(e,t,{get:function(){return n.value},set:function(e){n.value=e}})}(e,t,n)}))}}(e,e.$props),Z("function"==typeof o?o.call(e,e):o||{})},!n)return;if("function"!=typeof n)return},mounted:function(){ee(this)},updated:function(){ee(this)}})}function oe(e){return e}function ie(e){return function(t){var n,r=O(((n=e)[0].toUpperCase(),n.slice(1)));r&&function(e,t,n,r){var o=t.$options,i=e.config.optionMergeStrategies[n];o[n]=i(o[n],function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=b();h(e);try{return t.apply(void 0,w(n))}finally{h(o)}}}(t,r))}(y(),r,e,t)}}var ue,fe=ie("beforeMount"),ae=ie("mounted"),ce=ie("beforeUpdate"),le=ie("updated"),se=ie("beforeDestroy"),ve=ie("destroyed"),de=ie("errorCaptured"),pe=ie("activated"),ye=ie("deactivated"),be=ie("serverPrefetch");function he(){me(this,E)}function ge(){me(this,S)}function _e(){var e=b();return e?function(e){return void 0!==e[E]}(e)||function(e){e[E]=[],e[S]=[],e.$on("hook:beforeUpdate",he),e.$on("hook:updated",ge)}(e):(ue||(ue=j(y())),e=ue),e}function me(e,t){for(var n=e[t],r=0;r<n.length;r++)n[r]();n.length=0}function we(e,t,n){var r=function(){e.$nextTick((function(){e[E].length&&me(e,E),e[S].length&&me(e,S)}))};switch(n){case"pre":r(),e[E].push(t);break;case"post":r(),e[S].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] "+t)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+n)}}function Oe(e,t){var n=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(e,r),t()}}function je(e,t,n,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,t,n){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},l=function(t){return f||e===ue?t:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return we(e,(function(){t.apply(void 0,w(n))}),u)}};if(null===n){var d=!1,p=function(e,t,n,r){var o=e._watchers.length;return e.$watch(t,n,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!d)try{d=!0,t(a)}finally{d=!1}}),o,{deep:r.deep||!1,sync:f,before:c});Oe(p,c),p.lazy=!1;var y=p.get.bind(p);return p.get=l(y),function(){p.teardown()}}var b,h=r.deep;Array.isArray(t)?b=function(){return t.map((function(e){return B(e)?e.value:e()}))}:B(t)?b=function(){return t.value}:Q(t)?(b=function(){return t},h=!0):s(t)?b=t:(b=o,v("Invalid watch source: "+JSON.stringify(t)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var g=function(e,t){c(),n(e,t,a)},_=l(g);if(r.immediate){var m=_,O=function(e,t){O=m,g(e,t)};_=function(e,t){O(e,t)}}var j=e.$watch(b,_,{immediate:r.immediate,deep:h,sync:f});return Oe(e._watchers[e._watchers.length-1],c),function(){j()}}var $e={};var ke=function(e){return L(e,re)},xe={install:ke};d&&"undefined"!=typeof window&&window.Vue&&ke(window.Vue),e.computed=function(e){var t,n,r=b();"function"==typeof e?t=e:(t=e.get,n=e.set);var o=j(y(),{computed:{$$state:{get:t,set:n}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),U({get:function(){return o.$$state},set:function(e){o.$$state=e}})},e.createComponent=function(e){return e},e.createElement=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p?p.$createElement.apply(p,e):(v("`createElement()` has been called outside of render function."),X||(X=j(y()).$createElement),X.apply(X,e))},e.default=xe,e.defineComponent=oe,e.getCurrentInstance=b,e.inject=function(e,t){if(!e)return t;var n=b();if(n){var r=function(e,t){for(var n=t;n;){if(n._provided&&a(n._provided,e))return n._provided[e];n=n.$parent}return $e}(e,n);return r!==$e?r:t}v("inject() can only be used inside setup() or functional components.")},e.isReactive=Q,e.isRef=B,e.markRaw=H,e.onActivated=pe,e.onBeforeMount=fe,e.onBeforeUnmount=se,e.onBeforeUpdate=ce,e.onDeactivated=ye,e.onErrorCaptured=de,e.onMounted=ae,e.onServerPrefetch=be,e.onUnmounted=ve,e.onUpdated=le,e.provide=function(e,t){var n=O();if(n){if(!n._provided){var r={};Object.defineProperty(n,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}n._provided[e]=t}},e.reactive=G,e.ref=I,e.set=function(e,t,n){var r=y().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var i=e.__ob__;return e._isVue||i&&i.vmCount?n:i?(o(i.value,t,n),q(e,t,n),W(i.value[t]),i.dep.notify(),n):(e[t]=n,n)},e.shallowReactive=N,e.shallowRef=function(e){var t;if(B(e))return e;var n=N(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})},e.toRaw=function(e){return K(J)||!Object.isExtensible(e)?e:e.__ob__.value||e},e.toRef=V,e.toRefs=function(e){if(!l(e))return e;var t={};for(var n in e)t[n]=V(e,n);return t},e.triggerRef=function(e){B(e)&&(e.value=e.value)},e.unref=function(e){return B(e)?e.value:e},e.watch=function(e,t,n){var r=null;"function"==typeof t?r=t:(n=t,r=null);var o=function(e){return g({immediate:!1,deep:!1,flush:"post"},e)}(n);return je(_e(),e,r,o)},e.watchEffect=function(e,t){var n=function(e){return g({immediate:!0,deep:!1,flush:"post"},e)}(t);return je(_e(),e,null,n)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */var g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function O(e){return b()}function j(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function $(e){return d&&e instanceof d}function k(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.$scopedSlots[t]?e.$scopedSlots[t].apply(e,n):v("slots."+t+'() got called outside of the "render()" scope',e)}}function x(e){return r?Symbol.for(e):e}var E=x("vfa.key.preFlushQueue"),S=x("vfa.key.postFlushQueue"),P=x("vfa.key.accessControlIdentifier"),R=x("vfa.key.reactiveIdentifier"),A=x("vfa.key.rawIdentifierKey"),C="vfa.key.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function U(e){return Object.seal(new M(e))}function I(e){var t;if(B(e))return e;var n=G(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})}function B(e){return e instanceof M}function V(e,t){var n=e[t];return B(n)?n:U({get:function(){return e[t]},set:function(n){return e[t]=n}})}var z={},D={},F={};function K(e){return a(e,A)&&e[A]===F}function Q(e){return Object.isExtensible(e)&&a(e,R)&&e[R]===D}function T(e){if(!(!l(e)||K(e)||Array.isArray(e)||B(e)||$(e)||a(e,P)&&e[P]===z)){Object.isExtensible(e)&&f(e,P,z);for(var t=Object.keys(e),n=0;n<t.length;n++)q(e,t[n])}}function q(e,t,n){if("__ob__"!==t){var r,o,i=Object.getOwnPropertyDescriptor(e,t);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=e[t])}T(n),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):n;return t!==C&&B(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):n;t!==C&&B(u)&&!B(i)?u.value=i:o?o.call(e,i):n=i,T(i)}}})}}function J(e){var t,n=y();n.observable?t=n.observable(e):t=j(n,{data:{$$state:e}})._data.$$state;return t}function N(e){var t,n;if(!l(e)||Q(e)||K(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),T(r);var o=r.__ob__,i=function(t){var n,i,f=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable)return"continue";n=a.get,i=a.set,n&&!i||2!==u.length||(f=e[t])}Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){var t=n?n.call(e):f;return o.dep.depend(),t},set:function(t){n&&!i||(i?i.call(e,t):f=t,o.dep.notify())}})},u=arguments;try{for(var f=_(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return r}function W(e,t){if(void 0===t&&(t=!1),!(!l(e)||K(e)||Array.isArray(e)||B(e)||$(e)||a(e,R)&&e[R]===D||(Object.isExtensible(e)&&f(e,R,D),t)))for(var n=Object.keys(e),r=0;r<n.length;r++)W(e[n[r]])}function G(e){if(!l(e)||Q(e)||K(e)||!Object.isExtensible(e))return e;var t=J(e);return W(e),T(t),t}function H(e){return l(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,A,F),e):e}function L(e,t){d&&d===e||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return function e(t,n){if(!t)return n;if(!n)return t;for(var o,i,u,f=r?Reflect.ownKeys(t):Object.keys(t),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=n[o],u=t[o],a(n,o)?i!==u&&l(i)&&!B(i)&&l(u)&&!B(u)&&e(u,i):n[o]=u);return n}("function"==typeof e?e(n,o)||{}:void 0,"function"==typeof t?t(n,o)||{}:void 0)}},d=e,t(e))}var X,Y={set:function(e,t,n){(e.__secret_vfa_state__=e.__secret_vfa_state__||{})[t]=n},get:function(e,t){return(e.__secret_vfa_state__||{})[t]}};function Z(e){var t=Y.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,r=Y.get(e,"refs")||[],o=0;o<r.length;o++){var i=t[a=r[o]];!n[a]&&i&&B(i)&&(i.value=null)}var u=Object.keys(n),f=[];for(o=0;o<u.length;o++){var a;i=t[a=u[o]];n[a]&&i&&B(i)&&(i.value=n[a],f.push(a))}Y.set(e,"refs",f)}}function ee(e,t){var n=e.$options._parentVnode;if(n){for(var r=Y.get(e,"slots")||[],o=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var r in n={},e)e[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in t)r in n||(n[r]=!0);return n}(n.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete t[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;t[f=u[i]]||(t[f]=k(e,f))}Y.set(e,"slots",u)}}function te(e,t,n){var r=b();h(e);try{return t(e)}catch(e){if(!n)throw e;n(e)}finally{h(r)}}function ne(e){e.mixin({beforeCreate:function(){var e=this,t=e.$options,n=t.setup,r=t.render;r&&(t.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return te(e,(function(){return r.apply(t,n)}))});if(!n)return;if("function"!=typeof n)return;var o=t.data;t.data=function(){return function(e,t){void 0===t&&(t={});var n,r=e.$options.setup,o=function(e){var t={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(n){var r,o,i;Array.isArray(n)?(r=m(n,2),o=r[0],i=r[1]):o=i=n,i="$"+i,u(t,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(n){var r="$"+n;u(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e[r];o.apply(e,t)}}})})),t}(e);if(W(t),ee(e,o.slots),te(e,(function(){n=r(t,o)})),!n)return;if(s(n)){var i=n;return void(e.$options.render=function(){return ee(e,o.slots),te(e,(function(){return i()}))})}if(l(n)){var f=n;Y.set(e,"rawBindings",n),Object.keys(n).forEach((function(t){var n=f[t];B(n)||(Q(n)?n=I(n):(s(n)&&(n=n.bind(e)),n=I(H(function e(t,n){var r,o;if(void 0===n&&(n=new WeakMap),n.has(t))return n.get(t);if(s(t)||c(t)||Q(t)||!l(t)||!Object.isExtensible(t)||B(t)||K(t))return t;var i={};n.set(t,i),Object.getOwnPropertySymbols(t).forEach((function(e){return i[e]=t[e]}));var f=function(r){var o=t[r];if(!o||K(o))i[r]=o;else if(B(o)){u(i,r,{get:function(){return o.value},set:function(e){return o.value=e}})}else i[r]=e(o,n)};try{for(var a=_(Object.keys(t)),v=a.next();!v.done;v=a.next()){f(v.value)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(n))))),function(e,t,n){var r=e.$options.props;t in e||r&&a(r,t)||u(e,t,{get:function(){return n.value},set:function(e){n.value=e}})}(e,t,n)}))}}(e,e.$props),"function"==typeof o?o.call(e,e):o||{}}},mounted:function(){Z(this)},updated:function(){Z(this)}})}function re(e){return e}function oe(e){return function(t){var n,r=O(((n=e)[0].toUpperCase(),n.slice(1)));r&&function(e,t,n,r){var o=t.$options,i=e.config.optionMergeStrategies[n];o[n]=i(o[n],function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=b();h(e);try{return t.apply(void 0,w(n))}finally{h(o)}}}(t,r))}(y(),r,e,t)}}var ie,ue=oe("beforeMount"),fe=oe("mounted"),ae=oe("beforeUpdate"),ce=oe("updated"),le=oe("beforeDestroy"),se=oe("destroyed"),ve=oe("errorCaptured"),de=oe("activated"),pe=oe("deactivated"),ye=oe("serverPrefetch");function be(){_e(this,E)}function he(){_e(this,S)}function ge(){var e=b();return e?function(e){return void 0!==e[E]}(e)||function(e){e[E]=[],e[S]=[],e.$on("hook:beforeUpdate",be),e.$on("hook:updated",he)}(e):(ie||(ie=j(y())),e=ie),e}function _e(e,t){for(var n=e[t],r=0;r<n.length;r++)n[r]();n.length=0}function me(e,t,n){var r=function(){e.$nextTick((function(){e[E].length&&_e(e,E),e[S].length&&_e(e,S)}))};switch(n){case"pre":r(),e[E].push(t);break;case"post":r(),e[S].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] "+t)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+n)}}function we(e,t){var n=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(e,r),t()}}function Oe(e,t,n,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,t,n){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},l=function(t){return f||e===ie?t:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return me(e,(function(){t.apply(void 0,w(n))}),u)}};if(null===n){var d=!1,p=function(e,t,n,r){var o=e._watchers.length;return e.$watch(t,n,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!d)try{d=!0,t(a)}finally{d=!1}}),o,{deep:r.deep||!1,sync:f,before:c});we(p,c),p.lazy=!1;var y=p.get.bind(p);return p.get=l(y),function(){p.teardown()}}var b,h=r.deep;Array.isArray(t)?b=function(){return t.map((function(e){return B(e)?e.value:e()}))}:B(t)?b=function(){return t.value}:Q(t)?(b=function(){return t},h=!0):s(t)?b=t:(b=o,v("Invalid watch source: "+JSON.stringify(t)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var g=function(e,t){c(),n(e,t,a)},_=l(g);if(r.immediate){var m=_,O=function(e,t){O=m,g(e,t)};_=function(e,t){O(e,t)}}var j=e.$watch(b,_,{immediate:r.immediate,deep:h,sync:f});return we(e._watchers[e._watchers.length-1],c),function(){j()}}var je={};var $e=function(e){return L(e,ne)},ke={install:$e};d&&"undefined"!=typeof window&&window.Vue&&$e(window.Vue),e.computed=function(e){var t,n,r=b();"function"==typeof e?t=e:(t=e.get,n=e.set);var o=j(y(),{computed:{$$state:{get:t,set:n}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),U({get:function(){return o.$$state},set:function(e){o.$$state=e}})},e.createComponent=function(e){return e},e.createElement=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p?p.$createElement.apply(p,e):(v("`createElement()` has been called outside of render function."),X||(X=j(y()).$createElement),X.apply(X,e))},e.default=ke,e.defineComponent=re,e.getCurrentInstance=b,e.inject=function(e,t){if(!e)return t;var n=b();if(n){var r=function(e,t){for(var n=t;n;){if(n._provided&&a(n._provided,e))return n._provided[e];n=n.$parent}return je}(e,n);return r!==je?r:t}v("inject() can only be used inside setup() or functional components.")},e.isReactive=Q,e.isRef=B,e.markRaw=H,e.onActivated=de,e.onBeforeMount=ue,e.onBeforeUnmount=le,e.onBeforeUpdate=ae,e.onDeactivated=pe,e.onErrorCaptured=ve,e.onMounted=fe,e.onServerPrefetch=ye,e.onUnmounted=se,e.onUpdated=ce,e.provide=function(e,t){var n=O();if(n){if(!n._provided){var r={};Object.defineProperty(n,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}n._provided[e]=t}},e.reactive=G,e.ref=I,e.set=function(e,t,n){var r=y().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var i=e.__ob__;return e._isVue||i&&i.vmCount?n:i?(o(i.value,t,n),q(e,t,n),W(i.value[t]),i.dep.notify(),n):(e[t]=n,n)},e.shallowReactive=N,e.shallowRef=function(e){var t;if(B(e))return e;var n=N(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})},e.toRaw=function(e){return K(J)||!Object.isExtensible(e)?e:e.__ob__.value||e},e.toRef=V,e.toRefs=function(e){if(!l(e))return e;var t={};for(var n in e)t[n]=V(e,n);return t},e.triggerRef=function(e){B(e)&&(e.value=e.value)},e.unref=function(e){return B(e)?e.value:e},e.watch=function(e,t,n){var r=null;"function"==typeof t?r=t:(n=t,r=null);var o=function(e){return g({immediate:!1,deep:!1,flush:"post"},e)}(n);return Oe(ge(),e,r,o)},e.watchEffect=function(e,t){var n=function(e){return g({immediate:!0,deep:!1,flush:"post"},e)}(t);return Oe(ge(),e,null,n)},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@vue/composition-api", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "Provide logic composition capabilities for Vue.", | ||
@@ -16,2 +16,3 @@ "keywords": [ | ||
"umd:main": "dist/vue-composition-api.umd.js", | ||
"browser": "dist/vue-composition-api.umd.js", | ||
"module": "dist/vue-composition-api.module.js", | ||
@@ -18,0 +19,0 @@ "typings": "dist/index.d.ts", |
@@ -318,2 +318,17 @@ # Vue Composition API | ||
### :x: Reactive APIs in `data()` | ||
Passing `ref`, `reactive` or other reactive apis to `data()` would not work. | ||
```jsx | ||
export default { | ||
data() { | ||
return { | ||
// will result { a: { value: 1 } } in template | ||
a: ref(1) | ||
} | ||
}, | ||
}; | ||
``` | ||
## SSR | ||
@@ -320,0 +335,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201411
354
4416