Cześć ,jak zmienic style tak żeby wartosc została podania w px ,bo narazie mam w typie number
<textarea id="textarea" @scroll="focusTextarea" :style="styleObject" col="5" class="styleinput textarea" type="text" />
data(){
return {
isLoad : false,
styleObject: {
height : 45
}
}
},
watch :{
styleObject(old ,newV){
}
},
methods:{
focusTextarea:function(e){
console.log(e);
let curenValue;
let element = document.querySelector("#textarea");
let newValue = element.scrollTop;
curenValue = newValue;
tab2.push( newValue);
//.log(`to jest nowa warosc ${newValue} to jest stara warosc ${curenValue} warosc tablicy ${tab2}`);
//console.log( tab2);
//console.log(element.scrollHeight);
//console.log(tab2[tab2.length-1])
if( tab2[tab2.length-2] == undefined ){
this.styleObject.height += 5;
this.convert(this.styleObject.height);
console.log("+");
} if(tab2[tab2.length-1] > tab2[tab2.length-2] ){
console.log("+");
this.styleObject.height += 5;
this.convert(this.styleObject.height);
}else if( tab2[tab2.length-1] < tab2[tab2.length-2] ){
console.log("-")
this.styleObject.height -= 5;
this.convert(this.styleObject.height);
}
if( tab2[tab2.length-1] == 0 ){
tab2.splice(tab2.lenght-1);
console.log(tab2);
}