html部分
<div
class="crs-login"
:style="{'backgroundImage': 'url('+ company.loginImage +')',
backgroundRepeat:'no-repeat',
backgroundPosition:'60px center'}">
</div>
var app = new Vue({ //部分代码
el: "#login",
data: {
company: {
code: '',
fullname: '',
name: '',
title:'',
wallImage:'',
loginImage:'',
logo:''
},
},
created: function(){ //created唯部分代码
var _this = this;
getPublicInfo(function(result){
// console.log(result)请求的数据
_this.company.name = result.name;
_this.company.fullname = result.fullname;
_this.company.title = result.title || "xxxxxx"; //xxxxx唯默认显示结果
_this.company.wallImage = result.wallImage || "xxxxx";
_this.company.logo = result.logo || "xxxxxxx";
_this.company.loginImage = result.loginImage || "xxxxxxx";
},{
name: code
});
},
})