elementui 中 table 组件的 :height 属性

<el-table
        :height="`calc(100vh -  ${total > 50}}  ? 199px : 152px)`"
        :data="tableData"
        stripe
        :row-class-name="tableRowClassName"
        empty-text="暂无数据"
      >

为什么这样声明table表格高度 不生效 

这不是css,不能用calc()

<el-table

:height="`calc(100vh - ${total > 50} ? 199px : 152px)`"

:data="tableData"

stripe

:row-class-name="tableRowClassName"

empty-text="暂无数据"

>

不生效, 怎么回事




 

试试这种写法 https://blog.csdn.net/ZYS10000/article/details/109562171

total > 50?calc(100vh - '199px'): calc(100vh - '152px')

这样写