This commit is contained in:
X1627315083@163.com
2026-04-23 14:30:09 +08:00
parent 45298e5f23
commit 66b019eb2a
6 changed files with 57 additions and 12 deletions

View File

@@ -7,8 +7,9 @@ import feelingWithAiDA from "./feelingWithAiDA.vue";
import CommodityItem from "@/components/CommodityItem.vue";
//const props = defineProps({
//})
//const emit = defineEmits([
//])
const emit = defineEmits([
'addShopping'
])
let data = reactive({
})
const list = ref([
@@ -27,7 +28,7 @@ const list = ref([
},
])
const addShopping = (item) => {
console.log(item);
emit('addShopping', item)
}
onMounted(()=>{
})

View File

@@ -1,13 +1,16 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
import Detail from "./detail/index.vue";
import myEvent from '@/utils/myEvent'
//const props = defineProps({
//})
//const emit = defineEmits([
//])
let data = reactive({
})
const addShopping = (item) => {
myEvent.emit('addShopping', item)
}
onMounted(()=>{
})
onUnmounted(()=>{
@@ -47,7 +50,7 @@ const {} = toRefs(data);
</div>
</div>
<div class="content">
<Detail></Detail>
<Detail @addShopping="addShopping"></Detail>
</div>
<Footer></Footer>
</div>