<template>
<div v-bind:style="{ 'background-image': 'url(' + imageUrl + ')' }">
<!-- Your content here -->
</div>
</template>
<script>
import { reactive } from 'vue';
export default {
setup() {
const state = reactive({
imageUrl: 'your-image-url-here.jpg'
});
return { state };
}
}
</script>
vue3动态background-image
最新推荐文章于 2024-07-04 15:34:31 发布