在vue中,如何设置页面一加载就执行一个函数?
//页面加载时候执行,created(){axios.get('searchAll/1/20').then(response => {console.log(response);this.results = response.data;//绑定数据!})}使用,created()就行了...
·
//页面加载时候执行
,created()
{
axios.get('searchAll/1/20').then(response => {
console.log(response);
this.results = response.data;//绑定数据!
})
}
使用,created()就行了
更多推荐
已为社区贡献3条内容
所有评论(0)