mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-19 14:33:33 -04:00
custom component support inhert css
Signed-off-by: yaoyuchi <yaoyuchi@huawei.com>
This commit is contained in:
@@ -160,6 +160,23 @@ export function bindSubVm(vm: Vm, rawSubVm: Vm, rawTemplate: TemplateInterface,
|
||||
mergePropsObject(key, value, vm, subVm);
|
||||
});
|
||||
}
|
||||
|
||||
const attr = template.attr || {};
|
||||
for (const key in attr) {
|
||||
const value = attr[key];
|
||||
if (key === 'inhertClass') {
|
||||
const inhertClasss = value.split(' ');
|
||||
for (let x = 0; x < inhertClasss.length; x++) {
|
||||
const cssName = '.' + inhertClasss[x];
|
||||
const cssParent = vm._css[cssName];
|
||||
if (cssParent) {
|
||||
subVm._css[cssName] = cssParent;
|
||||
} else {
|
||||
console.error('cssParent is null');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user