|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
|
|
|
|
|
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout; |
|
|
|
|
|
|
|
|
|
function callLifeHook (self, life) { |
|
|
|
|
function callLifeHook(self, life) { |
|
|
|
|
var hooks = [], hook; |
|
|
|
|
hook = self[life]; |
|
|
|
|
if (hook) { |
|
|
|
@ -124,7 +124,7 @@
|
|
|
|
|
var initCallbackCalled = false; |
|
|
|
|
var renderCallbackCalled = false; |
|
|
|
|
|
|
|
|
|
function init () { |
|
|
|
|
function init() { |
|
|
|
|
// 加个保险
|
|
|
|
|
if (initCallbackCalled === true) { |
|
|
|
|
_global.console && console.error("组件: 请检查beforeInit内部的写法,callback只能执行一次"); |
|
|
|
@ -132,7 +132,7 @@
|
|
|
|
|
} |
|
|
|
|
initCallbackCalled = true; |
|
|
|
|
|
|
|
|
|
function render () { |
|
|
|
|
function render() { |
|
|
|
|
// 加个保险
|
|
|
|
|
if (renderCallbackCalled === true) { |
|
|
|
|
_global.console && console.error("组件: 请检查beforeRender内部的写法,callback只能执行一次"); |
|
|
|
@ -246,8 +246,8 @@
|
|
|
|
|
return getter.call(self, self); |
|
|
|
|
}, (handler && function (v) { |
|
|
|
|
handler.call(self, self, v); |
|
|
|
|
}) || BI.emptyFn, BI.extend({deep: true}, options)); |
|
|
|
|
this._watchers.push(function unwatchFn () { |
|
|
|
|
}) || BI.emptyFn, BI.extend({ deep: true }, options)); |
|
|
|
|
this._watchers.push(function unwatchFn() { |
|
|
|
|
watcher.teardown(); |
|
|
|
|
}); |
|
|
|
|
return watcher.value; |
|
|
|
@ -346,6 +346,7 @@
|
|
|
|
|
|
|
|
|
|
_initState: function () { |
|
|
|
|
this._isMounted = false; |
|
|
|
|
this._isDestroyed = false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
__initWatch: function () { |
|
|
|
@ -449,6 +450,10 @@
|
|
|
|
|
return this._isMounted; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isDestroyed: function () { |
|
|
|
|
return this._isDestroyed; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setWidth: function (w) { |
|
|
|
|
this.options.width = w; |
|
|
|
|
this._initElementWidth(); |
|
|
|
@ -681,11 +686,11 @@
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isEnabled: function () { |
|
|
|
|
return this.options.disabled === true ? false: !this.options._disabled; |
|
|
|
|
return this.options.disabled === true ? false : !this.options._disabled; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isValid: function () { |
|
|
|
|
return this.options.invalid === true ? false: !this.options._invalid; |
|
|
|
|
return this.options.invalid === true ? false : !this.options._invalid; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isVisible: function () { |
|
|
|
@ -732,6 +737,7 @@
|
|
|
|
|
this._isMounted = false; |
|
|
|
|
callLifeHook(this, "destroyed"); |
|
|
|
|
this.destroyed = null; |
|
|
|
|
this._isDestroyed = true; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_unMount: function () { |
|
|
|
@ -825,12 +831,12 @@
|
|
|
|
|
BI.Widget.context = context = contextStack.pop(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function pushTarget (_current) { |
|
|
|
|
function pushTarget(_current) { |
|
|
|
|
if (current) currentStack.push(current); |
|
|
|
|
BI.Widget.current = current = _current; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function popTarget () { |
|
|
|
|
function popTarget() { |
|
|
|
|
BI.Widget.current = current = currentStack.pop(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|