「years無いよ、year.idなんて無いよ」と言われてるかもしれません。
たぶんここあたりが問題?
methods: {
window: onload = function() {
for (let i = 0; i <= this.loop; i++) {
this.years.push(this.nowYear);
this.nowYear--;
}
}
},
動くかは未検証ですが、ざくっと書いてみます。
const LOOP_MAX = 30;
export default {
props: {
nowYear: Number,
},
computed: {
years () {
const counts = [...Array(LOOP_MAX +1).keys()];
return counts.map(count => {
return {
id : count +1,
value : this.nowYear - count
}
});
}
}
}
Like!