首先,你需要在 Vue 组件的 <template>
中添加一个元素,并使用 v-bind
绑定宽度和高度的属性:
<template>
<div v-bind:style="{ width: width + 'px', height: height + 'px' }">
</div>
</template>
首先,你需要在 Vue 组件的 <template>
中添加一个元素,并使用 v-bind
绑定宽度和高度的属性:
<template>
<div v-bind:style="{ width: width + 'px', height: height + 'px' }">
</div>
</template>