这是我组件的计算属性:
methods: {
addFavoritePlace(place_id) {
axios.post('/api/add-favorite-place', { place_id: place_id })
.then(response => {
// I need here force command.
});
},
},
computed: {
filteredPlaces: function () {
var is_open;
if (this.showOpened) {
is_open = 'open'
} else {
is_open = 'close'
}
return this.singlePlaces.filter((j) => {
return j.name.toLowerCase().match(this.search.toLowerCase();
});
}
}
Run Code Online (Sandbox Code Playgroud)
和我的标记:
methods: {
addFavoritePlace(place_id) {
axios.post('/api/add-favorite-place', { place_id: place_id })
.then(response => {
// I need here force command.
});
},
},
computed: {
filteredPlaces: function () { …Run Code Online (Sandbox Code Playgroud)