
为了向后兼容,sass 会提醒不推荐使用/
运算符。修改方式也告诉我们了,就是替换成math.div($spacer, 2)
。
进一步在sass的中文网站 查到这个函数的 API,对比下自己的版本有没有高于这个1.33.0
。如没有先去升级,否则直接修改即可。

但改完后报错了,说没有 math 模块。

解决方法是在前文档 style 标签内的最上方,所有代码之前,添加:
<style lang="scss" scoped>
@use "sass:math";
...其他样式代码
</style>
网友评论