diff --git a/README.md b/README.md index 1511959..f8bdb83 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,116 @@ -# Vue 3 + Vite +# 标签打印系统(Label Print System) -This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` - \ No newline at end of file diff --git a/src/components/24寸一体机_I5_3代_8G_256G.vue b/src/components/24寸一体机_I5_3代_8G_256G.vue index b5e7798..0e8ea0c 100644 --- a/src/components/24寸一体机_I5_3代_8G_256G.vue +++ b/src/components/24寸一体机_I5_3代_8G_256G.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/CustomTag.vue b/src/components/CustomTag.vue index 2185f22..aecc981 100644 --- a/src/components/CustomTag.vue +++ b/src/components/CustomTag.vue @@ -1,164 +1,82 @@ + + \ No newline at end of file + diff --git a/src/components/DynamicForm.vue b/src/components/DynamicForm.vue index f07af27..de4c21f 100644 --- a/src/components/DynamicForm.vue +++ b/src/components/DynamicForm.vue @@ -1,31 +1,32 @@ - - \ No newline at end of file diff --git a/src/components/G3260_8G_120G.vue b/src/components/G3260_8G_120G.vue index d1e00fe..7c30415 100644 --- a/src/components/G3260_8G_120G.vue +++ b/src/components/G3260_8G_120G.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/HardDisk.vue b/src/components/HardDisk.vue index c4e7f29..e99c63a 100644 --- a/src/components/HardDisk.vue +++ b/src/components/HardDisk.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/I3_4130_8G_120G.vue b/src/components/I3_4130_8G_120G.vue index 1578c7e..295540a 100644 --- a/src/components/I3_4130_8G_120G.vue +++ b/src/components/I3_4130_8G_120G.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/I5_10400F_16G_256G_1060.vue b/src/components/I5_10400F_16G_256G_1060.vue index edfd6ff..c18bdab 100644 --- a/src/components/I5_10400F_16G_256G_1060.vue +++ b/src/components/I5_10400F_16G_256G_1060.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/I5_10400F_16G_512G_2060.vue b/src/components/I5_10400F_16G_512G_2060.vue index c976866..d728d63 100644 --- a/src/components/I5_10400F_16G_512G_2060.vue +++ b/src/components/I5_10400F_16G_512G_2060.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/I5_4590_8G_120G.vue b/src/components/I5_4590_8G_120G.vue index fff676e..d37c6a2 100644 --- a/src/components/I5_4590_8G_120G.vue +++ b/src/components/I5_4590_8G_120G.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/I5_9400F_16G_256G_1060.vue b/src/components/I5_9400F_16G_256G_1060.vue index 1ec8cc8..dce4887 100644 --- a/src/components/I5_9400F_16G_256G_1060.vue +++ b/src/components/I5_9400F_16G_256G_1060.vue @@ -1,34 +1,22 @@ + - \ No newline at end of file diff --git a/src/components/LabelCell.vue b/src/components/LabelCell.vue new file mode 100644 index 0000000..8bd6c2a --- /dev/null +++ b/src/components/LabelCell.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/src/components/Main.vue b/src/components/Main.vue index a6b52cb..a7e85ef 100644 --- a/src/components/Main.vue +++ b/src/components/Main.vue @@ -1,40 +1,114 @@ \ No newline at end of file + diff --git a/src/components/Select/index.vue b/src/components/Select/index.vue index acfa7d6..7727009 100644 --- a/src/components/Select/index.vue +++ b/src/components/Select/index.vue @@ -47,13 +47,21 @@ import { } from '@headlessui/vue' // import { CheckIcon, ChevronUpDownIcon } from '@heroicons/vue/20/solid' -const props = defineProps(["data"]); -const selectedPerson = ref(props.data?.length > 0 ? props.data[0] : null); +const props = defineProps(["data", "modelValue"]); +const selectedPerson = ref(props.modelValue ?? (props.data?.length ? props.data[0] : null)); const emits = defineEmits(["update:modelValue"]); -watch([selectedPerson], ([newSelected]) => { - emits("update:modelValue", newSelected); +// 外部值变化时同步内部选中项(如“单格编辑”切换模板) +watch(() => props.modelValue, (val) => { + if (val) selectedPerson.value = val; +}); + +// 内部选中变化时通知父组件 +watch(selectedPerson, (newSelected) => { + if (newSelected !== props.modelValue) { + emits("update:modelValue", newSelected); + } })