需求:
写法:
对应 文件目录
pages\product\[class]\[brand]\[SPU].vue
pages/
--| product/----| [class]
------| [brand]
--------| [SPU].vue
script 内跳转方法
const router = useRouter()
const nuxtApp = useNuxtApp()
const jumpSPU = () => {
const params = {
class: item.class || '_',
brand: item.brand || '_',
SPU: item.id
}
router.push(nuxtApp.$localePath({ name: 'product-class-brand-SPU', params }))
}