是否可以将计算出的样式值输出为JSON对象?
...
ready: function() {
// themeClass = css mixin --theme-typography
style = this.getComputedStyleValue( this.themeClass );
console.log( style );
// outputs:
// font-size: 3.0000em;
// line-height: 1.0000em;
// margin-top: 0.5000em;
// margin-bottom: 0.0000em;
// font-weight: 400;
// font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}
但理想情况应该是:
{"font-size":"3.0000em;","line-height":"1.0000em;" etc.}
答案 0 :(得分:0)
const style = this.getComputedStyleValue( this.themeClass );
console.log( JSON.stringify(style) );
这不是一个聚合物问题。