vue

mac2022-06-30  26

1、模板字符串拼接id

<div class="thumbnail" :id="`ctrol_${item.id}`"> <i :class="'icon iconfont ' + item.icon"></i> </div>

效果

id="ctrol_1"

<div :style="{width: `${data.width}px`,height:`${data.height}px`,background:`red`}"> <canvas ref="canvas" class="elem-container" :width="canvasWidth" :height="canvasHeight" :style="assignStyle" /> </div>

模板字符串2

<div :style="'left:'+myOptions.getPosition()+'px;top:'+myOptions.getPosition()+'px'"> </div>

 

转载于:https://www.cnblogs.com/pengfei25/p/11428452.html

最新回复(0)