<template> <div id="welcome"> <div id="newwelcome" :class="{ welcome: !flag }"></div> </div> </template> <script> export default { name: "welcome", props: ["flag"], data: function() { return {}; }, methods: {}, mounted: function() {} }; </script> <style scoped> #welcome { width: 100%; height: 100%; } #Font { width: 100%; height: 100%; } #newwelcome { background: url("../../static/img/huanyingyehei_img.jpg") no-repeat; background-size: cover; width: 100%; height: 100%; } .welcome { background: url("../../static/img/huanyingye_img.jpg") no-repeat !important; background-size: cover !important; width: 100% !important; height: 100% !important; } </style>