new Vue({
el: '#app',
data: {
users: [{ name: '',procent:'' }],
},
methods: {
addUser(index) {
var vm = this
const attrValue = this.$refs.div.getAttribute('data-bullshit-attribute');
const attrValue2 = this.$refs.div2.getAttribute('data-lastnum-attribute');
console.log(attrValue2)
length=this.users.length
length2=length+parseInt(attrValue2);
this.users.push({
name: '',
procent: attrValue + '/'+(length+1),
});
},
deleteUser: function (index) {
console.log(index);
console.log(this.finds);
this.users.splice(index, 1);
if(index===0)
this.addUser()
},
},
mounted: function () {
const attrValue2 = this.$refs.div2.getAttribute('data-lastnum-attribute');
//procent:1,
}
});
Вопрос: как передать значение attrValue2 в procent?
data: {
users: [{ name: '',procent:'' }],
}