Vue.component('project-comp',{
template: `
@{{one.place}}
@{{one.time}}
`,
});
var app = new Vue({
el: '#root',
props:['projects'],
created: function () {
$.post(
'url',
{'city':'beijing'},
function(data){
this.projects = data;
},
'json'
);
},
});
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这个问题应该也是楼主吧,已经有答案了
是ajax那this作用域的问题,用箭头函数写或者局部变量存下this。
post请求中回调函数里面的this应该有问题