MCPcopy Create free account
hub / github.com/TruthHun/BookStack / getStyle

Function getStyle

static/vuejs/vue.esm.js:6034–6059  ·  view source on GitHub ↗

* parent component style should be after child's * so that parent component's style could override it

(vnode, checkChild)

Source from the content-addressed store, hash-verified

6032 * so that parent component's style could override it
6033 */
6034function getStyle (vnode, checkChild) {
6035 var res = {};
6036 var styleData;
6037
6038 if (checkChild) {
6039 var childNode = vnode;
6040 while (childNode.componentInstance) {
6041 childNode = childNode.componentInstance._vnode;
6042 if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
6043 extend(res, styleData);
6044 }
6045 }
6046 }
6047
6048 if ((styleData = normalizeStyleData(vnode.data))) {
6049 extend(res, styleData);
6050 }
6051
6052 var parentNode = vnode;
6053 while ((parentNode = parentNode.parent)) {
6054 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
6055 extend(res, styleData);
6056 }
6057 }
6058 return res
6059}
6060
6061/* */
6062

Callers 1

updateStyleFunction · 0.70

Calls 2

normalizeStyleDataFunction · 0.70
extendFunction · 0.70

Tested by

no test coverage detected