第一次在编辑器中将'params'获取为'{}',但是chrome可以获取真实值,当我刷新窗口时,它将'console'正确的值;
async asyncData({ store, params, query, route }) {
const product = {};
const slug = params.slug;
console.log(JSON.stringify(params));
console.log(JSON.stringify(route));
const products = await api.product.all(store.state.locale);
const currentProduct = products.find((item) => {
return item.slug === slug;
});}