intact-vue
Advanced tools
Comparing version 0.4.18 to 0.4.19
@@ -320,3 +320,2 @@ 'use strict'; | ||
var context = vNode.context; | ||
var $data = context.$data; | ||
props._context = { | ||
@@ -326,9 +325,10 @@ data: { | ||
if (name != null) { | ||
return _get($data, name); | ||
// for get both props and data | ||
return _get(context, name); | ||
} else { | ||
return $data; | ||
return context.$data; | ||
} | ||
}, | ||
set: function set$$1(name, value) { | ||
_set($data, name, value); | ||
_set(context, name, value); | ||
}, | ||
@@ -382,6 +382,3 @@ | ||
slots: props.slots(), | ||
context: { | ||
$data: props.parent.$data | ||
// $refs: props.parent.$refs, | ||
} | ||
context: props.parent | ||
}); | ||
@@ -388,0 +385,0 @@ var vNode = Component(_props, true /* is in vue */); |
@@ -322,3 +322,2 @@ (function (global, factory) { | ||
var context = vNode.context; | ||
var $data = context.$data; | ||
props._context = { | ||
@@ -328,9 +327,10 @@ data: { | ||
if (name != null) { | ||
return _get($data, name); | ||
// for get both props and data | ||
return _get(context, name); | ||
} else { | ||
return $data; | ||
return context.$data; | ||
} | ||
}, | ||
set: function set$$1(name, value) { | ||
_set($data, name, value); | ||
_set(context, name, value); | ||
}, | ||
@@ -384,6 +384,3 @@ | ||
slots: props.slots(), | ||
context: { | ||
$data: props.parent.$data | ||
// $refs: props.parent.$refs, | ||
} | ||
context: props.parent | ||
}); | ||
@@ -390,0 +387,0 @@ var vNode = Component(_props, true /* is in vue */); |
@@ -1,1 +0,1 @@ | ||
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e(require("vue"),require("intact/dist")):typeof define==="function"&&define.amd?define(["vue","intact/dist"],e):t.Intact=e(t.Vue,t.Intact)})(this,function(t,e){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t;e=e&&e.hasOwnProperty("default")?e["default"]:e;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var a=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var r=function(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof e)}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(e)Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e};var s=function(t,e){var r={};for(var n in t){if(e.indexOf(n)>=0)continue;if(!Object.prototype.hasOwnProperty.call(t,n))continue;r[n]=t[n]}return r};var u=function(t,e){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e&&(typeof e==="object"||typeof e==="function")?e:t};var i=e.Vdt.miss;var o=i.h;var f=i.hooks;var l=e.utils;var c=l.get;var p=l.set;var V=l.extend;var I=l.isArray;var d=l.create;var v=t.prototype._v("");var h=v.constructor;if(f){f.beforeInsert=function(t){var e=t.dom;var r=t.parentVNode;var n=void 0;var i=void 0;while(r){if((n=r.tag)&&n.cid==="IntactVue"&&(n=r.children.$options)){if((n=i=n.parent)&&(n=n.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}if(i){r=i.$parent;while(r){if((n=r.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}r=r.$parent}}break}else{r=r.parentVNode}}}}t.mixin({beforeCreate:function t(){if(!this.$parent&&this.$vnode){this.$parent=this.$vnode.context}}});function C(t){if(I(t)){var e=[];t.forEach(function(t){if(I(t)){e.push.apply(e,C(t))}else{e.push(y(t))}});return e}return y(t)}function y(t){if(t==null)return t;var e=typeof t==="undefined"?"undefined":n(t);if(e==="string"||e==="number")return t;if(t.type)return t;if(E(t)){var r=t.componentOptions;return o(r.Ctor,_(t),null,null,t.key,t.ref)}if(t.text!==undefined){return t.text}return o(b,{vueVNode:t},null,T(t))}function _(t){var e=t.componentOptions;var r=t.data;var n=r.attrs;var i=e.Ctor.propTypes;var o={};if(n){for(var a in n){if(~["staticClass","class","style","staticStyle"].indexOf(a))continue;var s=n[a];var u=void 0;if(i&&((u=i[a])===Boolean||u&&(I(u)&&u.indexOf(Boolean)>-1||u.type===Boolean||I(u.type)&&u.type.indexOf(Boolean)>-1))&&(s===""||s===a)){s=true}o[a]=s}}var f=T(t);if(f!==undefined){o.className=f}var l=A(t);if(l!==undefined){o.style=l}if(t.key){o.key=t.key}else if(r.key){o.key=r.key}var c=r.scopedSlots;if(c){var p=o._blocks?o._blocks:o._blocks={};var d=function t(i){p[i]=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++){r[n-1]=arguments[n]}return C(c[i].apply(this,r))}};for(var v in c){d(v)}}var h=r.model;if(h){o.value=h.value;o["v-model"]=h.expression}if(r.directives){var y=r.directives;for(var _=0;_<y.length;_++){var m=y[_];if(m.name==="model"){o.value=m.value;o["v-model"]=m.expression;break}else if(m.name==="show"&&!m.value){if(o.style){o.style.display="none"}else{o.style={display:"none"}}}}}S(t,o);var g=e.listeners;if(g){var $=function t(e){var n=g[e];var r=n;if(e==="input"){e="$change:value";r=function t(e,r){return n(r)}}else if(e.substr(0,7)==="update:"){e="$change:"+e.substr(7);r=function t(e,r){return n(r)}}var i="ev-"+e;if(o[i]){o[i]=[o[i],r]}else{o[i]=r}b=e};for(var b in g){$(b)}}var x=t.slots||F(e.children);var k=Q(x),N=k.children,O=k._blocks;o.children=N;if(o._blocks){V(o._blocks,O)}else{o._blocks=O}w(t,o);return o}function w(t,e){var r=t.context;var n=r.$data;e._context={data:{get:function t(e){if(e!=null){return c(n,e)}else{return n}},set:function t(e,r){p(n,e,r)},$router:c(r,"_routerRoot._router")}}}function Q(t){var e=t.default,r=s(t,["default"]);var n=void 0;if(r){n={};var i=function t(e){n[e]=function(){return C(r[e])}};for(var o in r){i(o)}}return{children:C(e),_blocks:n}}function m(u){function t(t){return u(t)}t.options={functional:true,render:function t(e,r){var n=_({componentOptions:{Ctor:u,listeners:r.listeners},data:r.data,slots:r.slots(),context:{$data:r.parent.$data}});var i=u(n,true);if(I(i)){throw new Error("Array children does not be supported.")}var o={};var a={attrs:o};for(var s in i.props){if(~["children","_context","className","style","ref","key"].indexOf(s))continue;o[s]=i.props[s]}if(r.data.ref){a.ref=r.data.ref}if(i.props.className){a.staticClass=i.props.className}if(i.props.style){a.staticStyle=i.props.style}a.key=i.props.key;return e(i.tag,a,i.props.children)}};t.cid="IntactFunctionalComponent";return t}var g=/_ev[A-Z]/;var $=t.prototype.__patch__;var b=function(){function t(){a(this,t)}t.prototype.init=function t(e,r){this.destroyed=true;this._addProps(r);return $(null,r.props.vueVNode,false,false,this.parentDom)};t.prototype.update=function t(e,r){this._addProps(r);return $(e.props.vueVNode,r.props.vueVNode,false,false,this.parentDom)};t.prototype.destroy=function t(e){$(e.props.vueVNode,null)};t.prototype._addProps=function t(e){this.vdt={vNode:e};var r=e.props;var n=r.vueVNode;for(var i in r){if(i==="vueVNode")continue;if(g.test(i))continue;if(!n.data)n.data={};var o=n.data;var a=r[i];if(i==="className"){o.staticClass=a;delete o.class}else if(i.substr(0,3)==="ev-"){if(!o.on)o.on={};o.on[i.substr(3)]=a}else{if(!o.attrs)o.attrs={};o.attrs[i]=a}}if(n.elm){r.vueVNode=q(n)}};return t}();function S(n,t){var i=n.data.ref;if(i){var o=n.context.$refs;t.ref=function(t,e){if(!o)return;if(!e){if(n.data.refInFor){if(!I(o[i])){o[i]=[t]}else if(o[i].indexOf(t)<0){o[i].push(t)}}else{o[i]=t}}else{if(I(o[i])){var r=o[i].indexOf(t);if(~r){o[i].splice(r,1)}}else{o[i]=undefined}}};t.ref.key=i}}function T(t){var e=void 0;var r=t.data;if(r){if(r.staticClass){e=r.staticClass}if(r.class){if(!e){e=x(r.class)}else{e+=" "+x(r.class)}}}return e}function x(t){if(t==null)return"";if(I(t)){return k(t)}if((typeof t==="undefined"?"undefined":n(t))==="object"){return N(t)}if(typeof t==="string"){return t}return""}function k(t){var e="";var r=void 0;for(var n=0;n<t.length;n++){if((r=x(t[n]))!=null&&r!==""){if(e)e+=" ";e+=r}}return e}function N(t){var e="";for(var r in t){if(t[r]){if(e)e+=" ";e+=r}}return e}function A(t){var e=void 0;var r=t.data;if(r){e=O(r.style);if(r.staticStyle){return V(r.staticStyle,e)}}return e}function O(t){if(!t)return t;if(I(t)){return M(t)}if(typeof t==="string"){return j(t)}return t}function M(t){var e={};for(var r=0;r<t.length;r++){if(t[r]){V(e,t[r])}}return e}var P=d(null);function j(t){var e=P[t];if(e)return e;var r={};var n=/;(?![^(]*\))/g;var i=/:(.+)/;t.split(n).forEach(function(t){if(t){var e=t.split(i);e.length>1&&(r[e[0].trim()]=e[1].trim())}});P[t]=r;return r}function E(t){var e=t.data;return e&&(e=e.hook)&&(e=e.init)&&t.componentOptions.Ctor.cid==="IntactVue"}function F(t){var e={};if(!t){return e}for(var r=0,n=t.length;r<n;r++){var i=t[r];var o=i.data;if(o&&o.attrs&&o.attrs.slot){delete o.attrs.slot}if(o&&o.slot!=null){var a=o.slot;var s=e[a]||(e[a]=[]);if(i.tag==="template"){s.push.apply(s,i.children||[])}else{s.push(i)}}else{(e.default||(e.default=[])).push(i)}}for(var u in e){if(e[u].every(B)){delete e[u]}}return e}function B(t){return t.isComment&&!t.asyncFactory||t.text===" "}function q(t){var e=new h(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);e.ns=t.ns;e.isStatic=t.isStatic;e.key=t.key;e.isComment=t.isComment;e.fnContext=t.fnContext;e.fnOptions=t.fnOptions;e.fnScopeId=t.fnScopeId;e.asyncMeta=t.asyncMeta;e.isCloned=true;return e}var D=t.prototype;var R=D.init;var z=D.$nextTick;var U=D._updateFromParent;var W=e.utils.extend;var Z=void 0;var G=void 0;var H=function(s){r(o,s);function o(t){a(this,o);var e=t&&t._parentVnode;if(e){var r=y(e);var n=u(this,s.call(this,r.props));t.mounted=[Z?function(){n.$nextTick(n.mount)}:n.mount];t._renderChildren=true;n.$options=t;n.$vnode=e;n._isVue=true;n.$scopedSlots={$stable:true};n.vNode=r;r.children=n;var i=t.parent;if(i){n.$parent=i;n.$root=i.$root;i.$children.push(n)}n.$children=[];n._data=n.props;n.$refs={};n._uid=n.uniqueId;t.name=n.displayName||n.constructor.name}else{var n=u(this,s.call(this,t))}return u(n)}o.prototype.init=function t(r,n){var i=this;var t=function t(){i.__pushActiveInstance();var e=s.prototype.init.call(i,r,n);i.__popActiveInstance();return e};if(!this._isVue)return t();G=this.mountedQueue;var e=t();return e};o.prototype.update=function t(r,n,i){var o=this;var t=function t(){o.__pushActiveInstance();var e=s.prototype.update.call(o,r,n,i);o.__popActiveInstance();return e};if(!this._isVue)return t();var e=this._shouldTrigger;this.__initMountedQueue();var a=t();this.__triggerMountedQueue();this._shouldTrigger=e;return a};o.prototype.$mount=function t(e,r){var n=this._shouldTrigger;this.__initMountedQueue();this.parentVNode=this.vNode.parentVNode=Z&&Z.vNode;this.inited=true;this.$el=this.init(null,this.vNode);this.vNode.dom=this.$el;this._vnode={};var i=this.$options;var o=i._refElm;var a=i._parentElm;if(a){if(o){a.insertBefore(this.$el,o)}else{a.appendChild(this.$el)}}this.$el.__vue__=this;this.__triggerMountedQueue();this._shouldTrigger=n};o.prototype.$forceUpdate=function t(){var e=this._shouldTrigger;this.__initMountedQueue();var r=y(this.$vnode);var n=this.vNode;r.children=this;this.vNode=r;this.parentVNode=this.vNode.parentVNode=Z&&Z.vNode;this.$vnode.elm=this.update(n,r);this.$options._renderChildren=true;var i=n.ref;var o=r.ref;if(i!==o&&!(i&&o&&i.key===o.key)){if(i){i(this,true)}if(o){o(this)}}this.__triggerMountedQueue();this._shouldTrigger=e};o.prototype.$destroy=function t(){delete this.$el.__vue__;var e=this.$parent;if(e){var r=e.$children;if(r.length){var n=r.indexOf(this);if(~n){r.splice(n,1)}}}this.destroy()};o.prototype.__initMountedQueue=function t(){this._shouldTrigger=false;if(!G||G.done){this._shouldTrigger=true;if(!this.mountedQueue||this.mountedQueue.done){this._initMountedQueue()}G=this.mountedQueue}else{this.mountedQueue=G}};o.prototype.__triggerMountedQueue=function t(){var e=this;if(this._shouldTrigger){if(this.mounted){this._triggerMountedQueue()}else{this.$options.mounted.push(function(){e._triggerMountedQueue()})}G=null;this._shouldTrigger=false}};o.prototype.__pushActiveInstance=function t(){this._prevActiveInstance=Z;Z=this};o.prototype.__popActiveInstance=function t(){Z=this._prevActiveInstance;this._prevActiveInstance=null};o.prototype.$on=function t(){};o.prototype.$off=function t(){};return o}(e);H.cid="IntactVue";H.options=W({},t.options);H.functionalWrapper=m;H.normalize=C;H.prototype.$nextTick=z;H.prototype._updateFromParent=U;if(!Object.setPrototypeOf){W(H,e);if(!H.template){H.template=e.template}}return H}); | ||
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e(require("vue"),require("intact/dist")):typeof define==="function"&&define.amd?define(["vue","intact/dist"],e):t.Intact=e(t.Vue,t.Intact)})(this,function(t,e){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t;e=e&&e.hasOwnProperty("default")?e["default"]:e;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var a=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var r=function(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof e)}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(e)Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e};var s=function(t,e){var r={};for(var n in t){if(e.indexOf(n)>=0)continue;if(!Object.prototype.hasOwnProperty.call(t,n))continue;r[n]=t[n]}return r};var u=function(t,e){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e&&(typeof e==="object"||typeof e==="function")?e:t};var i=e.Vdt.miss;var o=i.h;var f=i.hooks;var l=e.utils;var c=l.get;var p=l.set;var V=l.extend;var I=l.isArray;var d=l.create;var v=t.prototype._v("");var h=v.constructor;if(f){f.beforeInsert=function(t){var e=t.dom;var r=t.parentVNode;var n=void 0;var i=void 0;while(r){if((n=r.tag)&&n.cid==="IntactVue"&&(n=r.children.$options)){if((n=i=n.parent)&&(n=n.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}if(i){r=i.$parent;while(r){if((n=r.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}r=r.$parent}}break}else{r=r.parentVNode}}}}t.mixin({beforeCreate:function t(){if(!this.$parent&&this.$vnode){this.$parent=this.$vnode.context}}});function C(t){if(I(t)){var e=[];t.forEach(function(t){if(I(t)){e.push.apply(e,C(t))}else{e.push(y(t))}});return e}return y(t)}function y(t){if(t==null)return t;var e=typeof t==="undefined"?"undefined":n(t);if(e==="string"||e==="number")return t;if(t.type)return t;if(E(t)){var r=t.componentOptions;return o(r.Ctor,_(t),null,null,t.key,t.ref)}if(t.text!==undefined){return t.text}return o(b,{vueVNode:t},null,T(t))}function _(t){var e=t.componentOptions;var r=t.data;var n=r.attrs;var i=e.Ctor.propTypes;var o={};if(n){for(var a in n){if(~["staticClass","class","style","staticStyle"].indexOf(a))continue;var s=n[a];var u=void 0;if(i&&((u=i[a])===Boolean||u&&(I(u)&&u.indexOf(Boolean)>-1||u.type===Boolean||I(u.type)&&u.type.indexOf(Boolean)>-1))&&(s===""||s===a)){s=true}o[a]=s}}var f=T(t);if(f!==undefined){o.className=f}var l=A(t);if(l!==undefined){o.style=l}if(t.key){o.key=t.key}else if(r.key){o.key=r.key}var c=r.scopedSlots;if(c){var p=o._blocks?o._blocks:o._blocks={};var d=function t(i){p[i]=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++){r[n-1]=arguments[n]}return C(c[i].apply(this,r))}};for(var v in c){d(v)}}var h=r.model;if(h){o.value=h.value;o["v-model"]=h.expression}if(r.directives){var y=r.directives;for(var _=0;_<y.length;_++){var m=y[_];if(m.name==="model"){o.value=m.value;o["v-model"]=m.expression;break}else if(m.name==="show"&&!m.value){if(o.style){o.style.display="none"}else{o.style={display:"none"}}}}}S(t,o);var g=e.listeners;if(g){var $=function t(e){var n=g[e];var r=n;if(e==="input"){e="$change:value";r=function t(e,r){return n(r)}}else if(e.substr(0,7)==="update:"){e="$change:"+e.substr(7);r=function t(e,r){return n(r)}}var i="ev-"+e;if(o[i]){o[i]=[o[i],r]}else{o[i]=r}b=e};for(var b in g){$(b)}}var x=t.slots||F(e.children);var k=Q(x),N=k.children,O=k._blocks;o.children=N;if(o._blocks){V(o._blocks,O)}else{o._blocks=O}w(t,o);return o}function w(t,e){var n=t.context;e._context={data:{get:function t(e){if(e!=null){return c(n,e)}else{return n.$data}},set:function t(e,r){p(n,e,r)},$router:c(n,"_routerRoot._router")}}}function Q(t){var e=t.default,r=s(t,["default"]);var n=void 0;if(r){n={};var i=function t(e){n[e]=function(){return C(r[e])}};for(var o in r){i(o)}}return{children:C(e),_blocks:n}}function m(u){function t(t){return u(t)}t.options={functional:true,render:function t(e,r){var n=_({componentOptions:{Ctor:u,listeners:r.listeners},data:r.data,slots:r.slots(),context:r.parent});var i=u(n,true);if(I(i)){throw new Error("Array children does not be supported.")}var o={};var a={attrs:o};for(var s in i.props){if(~["children","_context","className","style","ref","key"].indexOf(s))continue;o[s]=i.props[s]}if(r.data.ref){a.ref=r.data.ref}if(i.props.className){a.staticClass=i.props.className}if(i.props.style){a.staticStyle=i.props.style}a.key=i.props.key;return e(i.tag,a,i.props.children)}};t.cid="IntactFunctionalComponent";return t}var g=/_ev[A-Z]/;var $=t.prototype.__patch__;var b=function(){function t(){a(this,t)}t.prototype.init=function t(e,r){this.destroyed=true;this._addProps(r);return $(null,r.props.vueVNode,false,false,this.parentDom)};t.prototype.update=function t(e,r){this._addProps(r);return $(e.props.vueVNode,r.props.vueVNode,false,false,this.parentDom)};t.prototype.destroy=function t(e){$(e.props.vueVNode,null)};t.prototype._addProps=function t(e){this.vdt={vNode:e};var r=e.props;var n=r.vueVNode;for(var i in r){if(i==="vueVNode")continue;if(g.test(i))continue;if(!n.data)n.data={};var o=n.data;var a=r[i];if(i==="className"){o.staticClass=a;delete o.class}else if(i.substr(0,3)==="ev-"){if(!o.on)o.on={};o.on[i.substr(3)]=a}else{if(!o.attrs)o.attrs={};o.attrs[i]=a}}if(n.elm){r.vueVNode=q(n)}};return t}();function S(n,t){var i=n.data.ref;if(i){var o=n.context.$refs;t.ref=function(t,e){if(!o)return;if(!e){if(n.data.refInFor){if(!I(o[i])){o[i]=[t]}else if(o[i].indexOf(t)<0){o[i].push(t)}}else{o[i]=t}}else{if(I(o[i])){var r=o[i].indexOf(t);if(~r){o[i].splice(r,1)}}else{o[i]=undefined}}};t.ref.key=i}}function T(t){var e=void 0;var r=t.data;if(r){if(r.staticClass){e=r.staticClass}if(r.class){if(!e){e=x(r.class)}else{e+=" "+x(r.class)}}}return e}function x(t){if(t==null)return"";if(I(t)){return k(t)}if((typeof t==="undefined"?"undefined":n(t))==="object"){return N(t)}if(typeof t==="string"){return t}return""}function k(t){var e="";var r=void 0;for(var n=0;n<t.length;n++){if((r=x(t[n]))!=null&&r!==""){if(e)e+=" ";e+=r}}return e}function N(t){var e="";for(var r in t){if(t[r]){if(e)e+=" ";e+=r}}return e}function A(t){var e=void 0;var r=t.data;if(r){e=O(r.style);if(r.staticStyle){return V(r.staticStyle,e)}}return e}function O(t){if(!t)return t;if(I(t)){return M(t)}if(typeof t==="string"){return j(t)}return t}function M(t){var e={};for(var r=0;r<t.length;r++){if(t[r]){V(e,t[r])}}return e}var P=d(null);function j(t){var e=P[t];if(e)return e;var r={};var n=/;(?![^(]*\))/g;var i=/:(.+)/;t.split(n).forEach(function(t){if(t){var e=t.split(i);e.length>1&&(r[e[0].trim()]=e[1].trim())}});P[t]=r;return r}function E(t){var e=t.data;return e&&(e=e.hook)&&(e=e.init)&&t.componentOptions.Ctor.cid==="IntactVue"}function F(t){var e={};if(!t){return e}for(var r=0,n=t.length;r<n;r++){var i=t[r];var o=i.data;if(o&&o.attrs&&o.attrs.slot){delete o.attrs.slot}if(o&&o.slot!=null){var a=o.slot;var s=e[a]||(e[a]=[]);if(i.tag==="template"){s.push.apply(s,i.children||[])}else{s.push(i)}}else{(e.default||(e.default=[])).push(i)}}for(var u in e){if(e[u].every(B)){delete e[u]}}return e}function B(t){return t.isComment&&!t.asyncFactory||t.text===" "}function q(t){var e=new h(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);e.ns=t.ns;e.isStatic=t.isStatic;e.key=t.key;e.isComment=t.isComment;e.fnContext=t.fnContext;e.fnOptions=t.fnOptions;e.fnScopeId=t.fnScopeId;e.asyncMeta=t.asyncMeta;e.isCloned=true;return e}var D=t.prototype;var R=D.init;var z=D.$nextTick;var U=D._updateFromParent;var W=e.utils.extend;var Z=void 0;var G=void 0;var H=function(s){r(o,s);function o(t){a(this,o);var e=t&&t._parentVnode;if(e){var r=y(e);var n=u(this,s.call(this,r.props));t.mounted=[Z?function(){n.$nextTick(n.mount)}:n.mount];t._renderChildren=true;n.$options=t;n.$vnode=e;n._isVue=true;n.$scopedSlots={$stable:true};n.vNode=r;r.children=n;var i=t.parent;if(i){n.$parent=i;n.$root=i.$root;i.$children.push(n)}n.$children=[];n._data=n.props;n.$refs={};n._uid=n.uniqueId;t.name=n.displayName||n.constructor.name}else{var n=u(this,s.call(this,t))}return u(n)}o.prototype.init=function t(r,n){var i=this;var t=function t(){i.__pushActiveInstance();var e=s.prototype.init.call(i,r,n);i.__popActiveInstance();return e};if(!this._isVue)return t();G=this.mountedQueue;var e=t();return e};o.prototype.update=function t(r,n,i){var o=this;var t=function t(){o.__pushActiveInstance();var e=s.prototype.update.call(o,r,n,i);o.__popActiveInstance();return e};if(!this._isVue)return t();var e=this._shouldTrigger;this.__initMountedQueue();var a=t();this.__triggerMountedQueue();this._shouldTrigger=e;return a};o.prototype.$mount=function t(e,r){var n=this._shouldTrigger;this.__initMountedQueue();this.parentVNode=this.vNode.parentVNode=Z&&Z.vNode;this.inited=true;this.$el=this.init(null,this.vNode);this.vNode.dom=this.$el;this._vnode={};var i=this.$options;var o=i._refElm;var a=i._parentElm;if(a){if(o){a.insertBefore(this.$el,o)}else{a.appendChild(this.$el)}}this.$el.__vue__=this;this.__triggerMountedQueue();this._shouldTrigger=n};o.prototype.$forceUpdate=function t(){var e=this._shouldTrigger;this.__initMountedQueue();var r=y(this.$vnode);var n=this.vNode;r.children=this;this.vNode=r;this.parentVNode=this.vNode.parentVNode=Z&&Z.vNode;this.$vnode.elm=this.update(n,r);this.$options._renderChildren=true;var i=n.ref;var o=r.ref;if(i!==o&&!(i&&o&&i.key===o.key)){if(i){i(this,true)}if(o){o(this)}}this.__triggerMountedQueue();this._shouldTrigger=e};o.prototype.$destroy=function t(){delete this.$el.__vue__;var e=this.$parent;if(e){var r=e.$children;if(r.length){var n=r.indexOf(this);if(~n){r.splice(n,1)}}}this.destroy()};o.prototype.__initMountedQueue=function t(){this._shouldTrigger=false;if(!G||G.done){this._shouldTrigger=true;if(!this.mountedQueue||this.mountedQueue.done){this._initMountedQueue()}G=this.mountedQueue}else{this.mountedQueue=G}};o.prototype.__triggerMountedQueue=function t(){var e=this;if(this._shouldTrigger){if(this.mounted){this._triggerMountedQueue()}else{this.$options.mounted.push(function(){e._triggerMountedQueue()})}G=null;this._shouldTrigger=false}};o.prototype.__pushActiveInstance=function t(){this._prevActiveInstance=Z;Z=this};o.prototype.__popActiveInstance=function t(){Z=this._prevActiveInstance;this._prevActiveInstance=null};o.prototype.$on=function t(){};o.prototype.$off=function t(){};return o}(e);H.cid="IntactVue";H.options=W({},t.options);H.functionalWrapper=m;H.normalize=C;H.prototype.$nextTick=z;H.prototype._updateFromParent=U;if(!Object.setPrototypeOf){W(H,e);if(!H.template){H.template=e.template}}return H}); |
{ | ||
"name": "intact-vue", | ||
"version": "0.4.18", | ||
"version": "0.4.19", | ||
"description": "A compatibility layer for running intact component in vue", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -230,3 +230,2 @@ import Intact from 'intact/dist'; | ||
const context = vNode.context; | ||
const $data = context.$data; | ||
props._context = { | ||
@@ -236,9 +235,10 @@ data: { | ||
if (name != null) { | ||
return get($data, name); | ||
// for get both props and data | ||
return get(context, name); | ||
} else { | ||
return $data; | ||
return context.$data; | ||
} | ||
}, | ||
set(name, value) { | ||
set($data, name, value); | ||
set(context, name, value); | ||
}, | ||
@@ -284,6 +284,3 @@ $router: get(context, '_routerRoot._router'), | ||
slots: props.slots(), | ||
context: { | ||
$data: props.parent.$data, | ||
// $refs: props.parent.$refs, | ||
}, | ||
context: props.parent, | ||
}); | ||
@@ -290,0 +287,0 @@ const vNode = Component(_props, true /* is in vue */); |
94660
2318