案例 <template> <div> <input type="text" v-model="num" id=""> </div> </template> <script setup lang="ts"> import { ref } from 'vue'; let num = ref('50px') </script> <style scoped lang="less"> div{ background: green; height: v-bind(num); } </style>