问题:运行calc(100% - 40px) 等于60%

错误原因:在less中 calc(100% - 40px) 等带单位混合运算会被less解析忽略单位,全部按照百分比计算,此例中的计算被less编译成calc(60%)
正确写法:
//less中使用calc写法
<style scoped lang="less">
@myHeight: 30px;
div{
height: calc(~"100% - @{myHeight}");
}
</style>
//less中变量写法
div{
width: ~"calc(100% - 40px)";
}
//或者
div{
width: calc(~"100% - 40px");
}
