From 3bb17db543675aed3784433eac95be6619b41945 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Mon, 1 Apr 2024 18:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/component/order.vue | 6 +++--- src/views/home/component/shop.vue | 17 ++++++++++++----- src/views/home/index.vue | 10 ++++++++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/views/home/component/order.vue b/src/views/home/component/order.vue index 9f77838..4c09b6b 100644 --- a/src/views/home/component/order.vue +++ b/src/views/home/component/order.vue @@ -11,10 +11,10 @@ const deleteOne = (index)=>{ list.value.splice(index,1) } -const getList = ()=>{ - list = { +const getList = (item)=>{ + list.value.push({ num: 1 - } + }) } defineExpose({ diff --git a/src/views/home/component/shop.vue b/src/views/home/component/shop.vue index 88ba95d..3ebacd0 100644 --- a/src/views/home/component/shop.vue +++ b/src/views/home/component/shop.vue @@ -11,15 +11,22 @@ const props = defineProps({ const emit = defineEmits(['getStoreList']) const bar_code = ref(''); -watch(bar_code, (val) => { - emit('getStoreList', { - bar_code: val - }) +watch(bar_code, (val, old) => { + console.log(val,old); + if(val.length - old.length>5) console.log('扫码枪输入'); + // emit('getStoreList', { + // bar_code: val + // }) }) const loadMore = () => { console.log("loadMore"); }; + +const changeItem = (item)=>{ + emit('changeItem', item) +} +