xcx-shop/src/views/demo/index.vue

26 lines
730 B
Vue

<template>
<div>
<van-cell-group>
<van-cell v-for="item in list" :title="item.title" :value="item.path" :key="item.path" @click="onClick(item)" is-link />
</van-cell-group>
</div>
</template>
<script setup lang="ts">
const list = [
{ title: '搜索结果', path: 'search-container' },
{ title: '商品详情', path: 'commodity-detail', query: { id: 4 } },
{ title: '我的订单', path: 'order' },
{ title: '订单详情', path: 'order/detail' },
{ title: '评价中心', path: 'review/center' },
{ title: '填写评价', path: 'review/write' },
]
const router = useRouter()
const onClick = (item: any) => {
router.push({ name: item.path, query: item.query })
}
</script>
<style scoped></style>