我在使用Gulp进行编译时遇到错误,尝试使用html属性data-list-count
进行计数但是当保存文件时,Gulp给出了错误
Potentially unhandled rejection [2] TypeError: Cannot read property 'denominator' of undefined
at Dimension.operate (/node_modules/less/lib/less/tree/dimension.js:87:58)
at Operation.eval (/node_modules/less/lib/less/tree/operation.js:31:18)
at Expression.eval (/node_modules/less/lib/less/tree/expression.js:31:37)
at Expression.eval (/node_modules/less/lib/less/tree/expression.js:31:37)
at Value.eval (/node_modules/less/lib/less/tree/value.js:18:30)
at Rule.eval (/node_modules/less/lib/less/tree/rule.js:56:33)
at Ruleset.eval (/node_modules/less/lib/less/tree/ruleset.js:149:50)
at Ruleset.eval (/node_modules/less/lib/less/tree/ruleset.js:149:50)
at Ruleset.eval (/node_modules/less/lib/less/tree/ruleset.js:149:50)
at Ruleset.eval (/node_modules/less/lib/less/tree/ruleset.js:149:50)
HTML(django的)
<ul data-list-count="4">
<li><a href="#live-chat">{% trans "Live Chat" %}</a></li>
<li><a href="#email-marketing">{% trans "Email Marketing" %}</a></li>
<li><a href="#marketing-automation">{% trans "Marketing automation" %}</a></li>
<li><a href="#mobile">{% trans "Mobile" %}</a></li>
</ul>
LESS:
li {
width: (100% / attr(data-list-count));
}
我确定LESS系列导致了它,但为什么以及如何修复它?