data() {
return {
fileList:[],
statevalue:0,
stateoption:[
{ text: '门', value: 0 },
{ text: '水龙头', value: 1 },
{ text: '床', value: 2 },
{ text:'喷头',value: 3 },
{ text:'抽水马桶',value: 4 }
],
areavalue:0,
areaoption:[
{ text:'龙泉校区', value: 0 },
{ text:'航空港校区',value: 1 },
],
rphone:'请填写手机号码',
rname:'请填写名字',
report:'请详尽填写报修内容'
}
},
methods: {
afterRead(file) {
console.log(file)
},
onOversize(file) {
alert('文件不能超过500kb')
},
//重置input长度
resetinput(){
let name = document.getElementById('reportman')
let phone = document.getElementById('reporphone')
let namelength = this.rname.length*0.36
let phonelength = this.rphone.length*0.36
name.style.width = namelength+'rem'
phone.style.width = phonelength+'rem'
}
},
钩子函数的获取方式:
mounted () {
var _this = this;
_this.resetinput()
console.log(_this.report.length)
}