diff --git a/runtime/main/model/directive.ts b/runtime/main/model/directive.ts index 39090186..6dd98023 100644 --- a/runtime/main/model/directive.ts +++ b/runtime/main/model/directive.ts @@ -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; diff --git a/runtime/main/model/index.ts b/runtime/main/model/index.ts index 17e26852..a4e7f966 100644 --- a/runtime/main/model/index.ts +++ b/runtime/main/model/index.ts @@ -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 = {};