Skip to content

Commit f86a8bb

Browse files
author
Rishabh Karnad
committed
Created build for version 0.1.3
1 parent f57a6ce commit f86a8bb

File tree

2 files changed

+58
-18
lines changed

2 files changed

+58
-18
lines changed

packages/vue-native-core/build.js

+57-18
Original file line numberDiff line numberDiff line change
@@ -3530,23 +3530,6 @@ initMixin(Vue);
35303530
stateMixin(Vue);
35313531
eventsMixin(Vue);
35323532

3533-
/**
3534-
* react-vue change
3535-
*/
3536-
// lifecycleMixin(Vue)
3537-
// renderMixin(Vue)
3538-
3539-
/**
3540-
* react-vue change
3541-
*/
3542-
Vue.prototype.$nextTick = function (fn) {
3543-
return nextTick(fn, this)
3544-
};
3545-
3546-
Vue.prototype.$destroy = function (fn) {
3547-
// nothing
3548-
};
3549-
35503533
/* */
35513534

35523535
function initUse (Vue) {
@@ -3877,7 +3860,63 @@ Object.defineProperty(Vue.prototype, '$isServer', {
38773860
get: isServerRendering
38783861
});
38793862

3880-
Vue.version = '0.1.1';
3863+
Vue.version = '0.1.3';
3864+
3865+
//
3866+
3867+
function lifeCycleMixin (Vue) {
3868+
Vue.prototype.$destroy = function (fn) {
3869+
var vm = this;
3870+
if (vm._isBeingDestroyed) {
3871+
return
3872+
}
3873+
// callHook(vm, 'beforeDestroy')
3874+
vm._isBeingDestroyed = true;
3875+
// remove self from parent
3876+
var parent = vm.$parent;
3877+
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
3878+
remove(parent.$children, vm);
3879+
}
3880+
// teardown watchers
3881+
if (vm._watcher) {
3882+
vm._watcher.teardown();
3883+
}
3884+
var i = vm._watchers.length;
3885+
while (i--) {
3886+
vm._watchers[i].teardown();
3887+
}
3888+
// remove reference from data ob
3889+
// frozen object may not have observer.
3890+
if (vm._data.__ob__) {
3891+
vm._data.__ob__.vmCount--;
3892+
}
3893+
// call the last hook...
3894+
vm._isDestroyed = true;
3895+
// invoke destroy hooks on current rendered tree
3896+
// vm.__patch__(vm._vnode, null)
3897+
// fire destroyed hook
3898+
// callHook(vm, 'destroyed')
3899+
// turn off all instance listeners.
3900+
vm.$off();
3901+
// remove __vue__ reference
3902+
if (vm.$el) {
3903+
vm.$el.__vue__ = null;
3904+
}
3905+
// remove reference to DOM nodes (prevents leak)
3906+
vm.$options._parentElm = vm.$options._refElm = null;
3907+
};
3908+
}
3909+
3910+
//
3911+
3912+
function renderMixin (Vue) {
3913+
Vue.prototype.$nextTick = function (fn) {
3914+
return nextTick(fn, this)
3915+
};
3916+
}
3917+
3918+
lifeCycleMixin(Vue);
3919+
renderMixin(Vue);
38813920

38823921
/**
38833922
* Reference to mobx https://github.com/mobxjs/mobx-react-vue/blob/master/src/observer.js

packages/vue-native-helper/build.js

+1
Original file line numberDiff line numberDiff line change
@@ -4088,6 +4088,7 @@ function buildNativeComponent (render, options, config) {
40884088
var this$1 = this;
40894089

40904090
this.beforeDestroy.forEach(function (v) { return v.call(this$1.vm); });
4091+
this.vm.$destroy();
40914092
};
40924093
ReactVueComponent.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps (nextProps) {
40934094
this.vm._props && Object.assign(this.vm._props, nextProps);

0 commit comments

Comments
 (0)