omi - change this._host to this.rootNode
This commit is contained in:
parent
29170c701b
commit
ad0a38d729
|
@ -108,7 +108,7 @@ declare namespace Omi {
|
|||
props: RenderableProps<P>;
|
||||
data?: D;
|
||||
prevProps: RenderableProps<P>;
|
||||
host?: HTMLElement;
|
||||
rootNode?: HTMLElement;
|
||||
normalizedNodeName?: string;
|
||||
elementId: number;
|
||||
|
||||
|
@ -139,7 +139,7 @@ declare namespace Omi {
|
|||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
prevProps: RenderableProps<P>;
|
||||
host: HTMLElement;
|
||||
rootNode?: HTMLElement;
|
||||
|
||||
update(ignoreAttrs?:boolean): void;
|
||||
fire(name: string, data?: any): void;
|
||||
|
@ -162,7 +162,7 @@ declare namespace Omi {
|
|||
props: RenderableProps<P>;
|
||||
data?: D;
|
||||
prevProps: RenderableProps<P>;
|
||||
host?: HTMLElement;
|
||||
rootNode?: HTMLElement;
|
||||
normalizedNodeName?: string;
|
||||
elementId: number;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* omi v6.6.7 http://omijs.org
|
||||
* omi v6.6.8 http://omijs.org
|
||||
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
|
||||
* By dntzhang https://github.com/dntzhang
|
||||
* Github: https://github.com/Tencent/omi
|
||||
|
@ -1353,7 +1353,7 @@
|
|||
var rendered = this.render(this.props, this.data, this.store);
|
||||
this.__hasChildren = Object.prototype.toString.call(rendered) === '[object Array]' && rendered.length > 0;
|
||||
|
||||
this._host = diff(null, rendered, {}, false, null, false);
|
||||
this.rootNode = diff(null, rendered, {}, false, null, false);
|
||||
this.rendered();
|
||||
|
||||
if (this.props.css) {
|
||||
|
@ -1362,12 +1362,12 @@
|
|||
shadowRoot.appendChild(this._customStyleElement);
|
||||
}
|
||||
|
||||
if (isArray(this._host)) {
|
||||
this._host.forEach(function (item) {
|
||||
if (isArray(this.rootNode)) {
|
||||
this.rootNode.forEach(function (item) {
|
||||
shadowRoot.appendChild(item);
|
||||
});
|
||||
} else {
|
||||
shadowRoot.appendChild(this._host);
|
||||
shadowRoot.appendChild(this.rootNode);
|
||||
}
|
||||
this.installed();
|
||||
this._isInstalled = true;
|
||||
|
@ -1400,7 +1400,7 @@
|
|||
var rendered = this.render(this.props, this.data, this.store);
|
||||
this.__hasChildren = this.__hasChildren || Object.prototype.toString.call(rendered) === '[object Array]' && rendered.length > 0;
|
||||
|
||||
this._host = diff(this._host, rendered, null, null, this.shadowRoot);
|
||||
this.rootNode = diff(this.rootNode, rendered, null, null, this.shadowRoot);
|
||||
this._willUpdate = false;
|
||||
this.updated();
|
||||
};
|
||||
|
@ -1804,7 +1804,7 @@
|
|||
|
||||
options.root.Omi = omi;
|
||||
options.root.omi = omi;
|
||||
options.root.Omi.version = '6.6.7';
|
||||
options.root.Omi.version = '6.6.8';
|
||||
|
||||
if (typeof module != 'undefined') module.exports = omi;else self.Omi = omi;
|
||||
}());
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* omi v6.6.7 http://omijs.org
|
||||
* omi v6.6.8 http://omijs.org
|
||||
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
|
||||
* By dntzhang https://github.com/dntzhang
|
||||
* Github: https://github.com/Tencent/omi
|
||||
|
@ -1350,7 +1350,7 @@ var WeElement = function (_HTMLElement) {
|
|||
var rendered = this.render(this.props, this.data, this.store);
|
||||
this.__hasChildren = Object.prototype.toString.call(rendered) === '[object Array]' && rendered.length > 0;
|
||||
|
||||
this._host = diff(null, rendered, {}, false, null, false);
|
||||
this.rootNode = diff(null, rendered, {}, false, null, false);
|
||||
this.rendered();
|
||||
|
||||
if (this.props.css) {
|
||||
|
@ -1359,12 +1359,12 @@ var WeElement = function (_HTMLElement) {
|
|||
shadowRoot.appendChild(this._customStyleElement);
|
||||
}
|
||||
|
||||
if (isArray(this._host)) {
|
||||
this._host.forEach(function (item) {
|
||||
if (isArray(this.rootNode)) {
|
||||
this.rootNode.forEach(function (item) {
|
||||
shadowRoot.appendChild(item);
|
||||
});
|
||||
} else {
|
||||
shadowRoot.appendChild(this._host);
|
||||
shadowRoot.appendChild(this.rootNode);
|
||||
}
|
||||
this.installed();
|
||||
this._isInstalled = true;
|
||||
|
@ -1397,7 +1397,7 @@ var WeElement = function (_HTMLElement) {
|
|||
var rendered = this.render(this.props, this.data, this.store);
|
||||
this.__hasChildren = this.__hasChildren || Object.prototype.toString.call(rendered) === '[object Array]' && rendered.length > 0;
|
||||
|
||||
this._host = diff(this._host, rendered, null, null, this.shadowRoot);
|
||||
this.rootNode = diff(this.rootNode, rendered, null, null, this.shadowRoot);
|
||||
this._willUpdate = false;
|
||||
this.updated();
|
||||
};
|
||||
|
@ -1801,7 +1801,7 @@ var omi = {
|
|||
|
||||
options.root.Omi = omi;
|
||||
options.root.omi = omi;
|
||||
options.root.Omi.version = '6.6.7';
|
||||
options.root.Omi.version = '6.6.8';
|
||||
|
||||
export default omi;
|
||||
export { tag, WeElement, Component, render, h, h as createElement, options, define, observe, cloneElement, getHost, rpx, tick, nextTick, ModelView, defineElement, classNames, extractClass, createRef, html, htm, o, elements };
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -912,16 +912,16 @@
|
|||
}
|
||||
var rendered = this.render(this.props, this.data, this.store);
|
||||
this.P = '[object Array]' === Object.prototype.toString.call(rendered) && rendered.length > 0;
|
||||
this.L = diff(null, rendered, {}, !1, null, !1);
|
||||
this.rootNode = diff(null, rendered, {}, !1, null, !1);
|
||||
this.rendered();
|
||||
if (this.props.css) {
|
||||
this.N = cssToDom(this.props.css);
|
||||
this.O = this.props.css;
|
||||
shadowRoot.appendChild(this.N);
|
||||
}
|
||||
if (isArray(this.L)) this.L.forEach(function(item) {
|
||||
if (isArray(this.rootNode)) this.rootNode.forEach(function(item) {
|
||||
shadowRoot.appendChild(item);
|
||||
}); else shadowRoot.appendChild(this.L);
|
||||
}); else shadowRoot.appendChild(this.rootNode);
|
||||
this.installed();
|
||||
this.B = !0;
|
||||
};
|
||||
|
@ -944,7 +944,7 @@
|
|||
this.attrsToProps(ignoreAttrs);
|
||||
var rendered = this.render(this.props, this.data, this.store);
|
||||
this.P = this.P || '[object Array]' === Object.prototype.toString.call(rendered) && rendered.length > 0;
|
||||
this.L = diff(this.L, rendered, null, null, this.shadowRoot);
|
||||
this.rootNode = diff(this.rootNode, rendered, null, null, this.shadowRoot);
|
||||
this.J = !1;
|
||||
this.updated();
|
||||
};
|
||||
|
@ -1083,7 +1083,7 @@
|
|||
};
|
||||
options.root.Omi = omi;
|
||||
options.root.omi = omi;
|
||||
options.root.Omi.version = '6.6.7';
|
||||
options.root.Omi.version = '6.6.8';
|
||||
if ('undefined' != typeof module) module.exports = omi; else self.Omi = omi;
|
||||
}();
|
||||
//# sourceMappingURL=omi.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "omi",
|
||||
"version": "6.6.7",
|
||||
"version": "6.6.8",
|
||||
"description": "Front End Cross-Frameworks Framework.",
|
||||
"main": "dist/omi.js",
|
||||
"jsnext:main": "dist/omi.esm.js",
|
||||
|
|
|
@ -108,7 +108,7 @@ declare namespace Omi {
|
|||
props: RenderableProps<P>;
|
||||
data?: D;
|
||||
prevProps: RenderableProps<P>;
|
||||
host?: HTMLElement;
|
||||
rootNode?: HTMLElement;
|
||||
normalizedNodeName?: string;
|
||||
elementId: number;
|
||||
|
||||
|
@ -139,7 +139,7 @@ declare namespace Omi {
|
|||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
prevProps: RenderableProps<P>;
|
||||
host: HTMLElement;
|
||||
rootNode?: HTMLElement;
|
||||
|
||||
update(ignoreAttrs?:boolean): void;
|
||||
fire(name: string, data?: any): void;
|
||||
|
@ -162,7 +162,7 @@ declare namespace Omi {
|
|||
props: RenderableProps<P>;
|
||||
data?: D;
|
||||
prevProps: RenderableProps<P>;
|
||||
host?: HTMLElement;
|
||||
rootNode?: HTMLElement;
|
||||
normalizedNodeName?: string;
|
||||
elementId: number;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ const omi = {
|
|||
|
||||
options.root.Omi = omi
|
||||
options.root.omi = omi
|
||||
options.root.Omi.version = '6.6.7'
|
||||
options.root.Omi.version = '6.6.8'
|
||||
|
||||
export default omi
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ export default class WeElement extends HTMLElement {
|
|||
const rendered = this.render(this.props, this.data, this.store)
|
||||
this.__hasChildren = Object.prototype.toString.call(rendered) ==='[object Array]' && rendered.length > 0
|
||||
|
||||
this._host = diff(
|
||||
this.rootNode = diff(
|
||||
null,
|
||||
rendered,
|
||||
{},
|
||||
|
@ -86,12 +86,12 @@ export default class WeElement extends HTMLElement {
|
|||
shadowRoot.appendChild(this._customStyleElement)
|
||||
}
|
||||
|
||||
if (isArray(this._host)) {
|
||||
this._host.forEach(function (item) {
|
||||
if (isArray(this.rootNode)) {
|
||||
this.rootNode.forEach(function (item) {
|
||||
shadowRoot.appendChild(item)
|
||||
})
|
||||
} else {
|
||||
shadowRoot.appendChild(this._host)
|
||||
shadowRoot.appendChild(this.rootNode)
|
||||
}
|
||||
this.installed()
|
||||
this._isInstalled = true
|
||||
|
@ -124,8 +124,8 @@ export default class WeElement extends HTMLElement {
|
|||
const rendered = this.render(this.props, this.data, this.store)
|
||||
this.__hasChildren = this.__hasChildren || (Object.prototype.toString.call(rendered) ==='[object Array]' && rendered.length > 0)
|
||||
|
||||
this._host = diff(
|
||||
this._host,
|
||||
this.rootNode = diff(
|
||||
this.rootNode,
|
||||
rendered,
|
||||
null,
|
||||
null,
|
||||
|
|
Loading…
Reference in New Issue