【发布时间】:2023-02-10 19:59:26
【问题描述】:
单击按钮时,我正在尝试更新名为 URL 的 axios 中的“this.counts”值。谁能帮我解决这个问题?谢谢
.get(
"https://myurl/results.json" +
query +
`&num_ranks=$**{this.counts}**`
data: function () {
return {
counts: 2
};
methods: {
//number added to the Axios URL to display load more results
loadMore() {
if (this.loadMore) {
this.counts += 10;
}
},
}
<button
@click="loadMore">
Load more {{ counts }}
</button>
【问题讨论】: