图片叠加
<template> <div id="bg_img"> <img src="/static/img/pexels-pixabay-209831.jpg" alt="叠加图片" height="100%" width="100%" /> </div> </template> <script> export default { data() { return {}; }, methods: {}, mounted() {} }; </script> <style scoped> #bg_img { width: 100%; height: 100vh; background: url("../../static/img/pexels-mabel-amber-125457.jpg") no-repeat; background-size: 100% 100%; } #bg_img img { object-fit: cover; opacity: 0.4; } </style>