fix inheritClass

Signed-off-by: seaside_wu <wuhaibin5@huawei.com>
Change-Id: Id7f2e5038e7c839236e71eeab46950eefdb69fe3
This commit is contained in:
seaside_wu
2022-11-09 18:18:40 +08:00
committed by seaside
parent 50ab169f94
commit 55f7d32e45
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -184,10 +184,10 @@ export function bindSubVm(vm: Vm, rawSubVm: Vm, rawTemplate: TemplateInterface,
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];
if (key === 'inheritClass') {
const inheritClasses = value.split(' ');
for (let x = 0; x < inheritClasses.length; x++) {
const cssName = '.' + inheritClasses[x];
const cssParent = vm._css[cssName];
if (cssParent) {
subVm._css[cssName] = cssParent;
+1 -1
View File
@@ -128,7 +128,7 @@ export default class Vm {
const shareData = options.shareData || {};
this.__vmOptions = options;
this.__computed = options.computed;
this.__css = options.style;
this.__css = options.style || {};
this.__selector = selector(this.__css);
this.__ids = {};
this.$refs = {};