mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2025-11-19 14:06:48 +08:00
34 lines
663 B
Vue
34 lines
663 B
Vue
<template>
|
|
<nut-card
|
|
v-for="(item, index) in list"
|
|
:key="index"
|
|
:img-url="item.imgUrl"
|
|
:title="item.title"
|
|
:price="item.price"
|
|
:vip-price="item.vipPrice"
|
|
:shop-name="item.shopName"
|
|
:shopDesc="item.shopDesc"
|
|
:delivery="item.delivery"
|
|
@click="(_e) => toDetails(index)"
|
|
/>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { listData } from './data';
|
|
|
|
const router = useRouter();
|
|
|
|
const list = ref(listData);
|
|
|
|
const toDetails = (index) => {
|
|
router.push({ path: '/details', query: { id: index } });
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.nut-card {
|
|
padding: 15px;
|
|
border-bottom: 1px solid #e5e5e5;
|
|
}
|
|
</style>
|