Sam*_*mmi 5 javascript css vue.js
我的组件的模板包含这个 html 元素:
.grid-item(:style="{ width: columnWidth, backgroundColor: 'blue' }")
Run Code Online (Sandbox Code Playgroud)
我想使用计算属性设置其宽度值:
computed: {
columnWidth () {
return ((this.maxWidth - ( this.marginWidth * 2)) - ((this.columnsCount - 1) * this.gutterWidth)) / this.columnsCount;
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能以正确的方式实现这一目标?
问题显然出在:style="{ width: columnWidth零件上,因为当我设置它时,每件事都完美无缺width:'20px'。
| 归档时间: |
|
| 查看次数: |
7795 次 |
| 最近记录: |