1.HTML
<div class="login-item" :style="{ 'background-image': userBg }">
2.计算属性
computed: {
...mapState(["USER", "CUSTOMCODE", "USERPERMISSIONS"]),
userBg() {
const url = require("../../static/image/custom/" +
this.CUSTOMCODE +
"/loginBg.png");
return "url(" + url + ")";
},
loginBg() {
return this.loginType === 0
? require("../../static/image/login/earth.png")
: require("../../static/image/login/plate.png");
},
},
3.HTML静态绑定图片
<image class="image__453" src="/static/image/login2/logo.png" />