Class 属性 不添加到 HTML 而 openui5 转换 XML

Class property does not added to HTML while openui5 converts XML

我在 XML 视图中添加了 "footerAlarms" 值,但在 HTML 版本中它没有出现在浏览器中。那么我该怎么做才能在 HTML 视图中看到 class footerAlarms。

<footer class="footerAlarms">
            <Toolbar>
                <ToolbarSpacer/>    
                <Link text="{i18n>readMeOss}" press="openSourceFileDownload" class="sapUiMediumMarginBegin LinkOss"/>                                           
            </Toolbar>
</footer>


footer.footerAlarms {
    height: 42px !important;
    width:calc(100%-32px);
    margin:0 16px 0 16px !important;
    background: #FFFFFF !important;
    box-shadow: 
    0 1px 0 0 rgba(255,255,255,0.60),
    inset 0 -1px 0 0 rgba(115,100,90,0.16);
}

你忘记了 footer.footerAlarms 之前的点,所以它应该是:

.footer.footerAlarms {
    height: 42px !important;
    width:calc(100%-32px);
    margin:0 16px 0 16px !important;
    background: #FFFFFF !important;
    box-shadow: 
    0 1px 0 0 rgba(255,255,255,0.60),
    inset 0 -1px 0 0 rgba(115,100,90,0.16);
}

已编辑 291117 15:27:

抱歉,试试这个:

.footerAlarms {
        height: 42px !important;
        width:calc(100%-32px);
        margin:0 16px 0 16px !important;
        background: #FFFFFF !important;
        box-shadow: 
        0 1px 0 0 rgba(255,255,255,0.60),
        inset 0 -1px 0 0 rgba(115,100,90,0.16);
    }

我的工作

onAfterRendering : function(){
    $("footer").addClass("footerAlarms");
  }

CSS

.footerAlarms {
    height: 42px !important;
    // space is needed for the value inside braces below
    width:calc(100% - 32px);
    margin:0 16px 0 16px !important;
    background: #FFFFFF !important;
    box-shadow: 
    0 1px 0 0 rgba(255,255,255,0.60),
    inset 0 -1px 0 0 rgba(115,100,90,0.16);
}