From 92d0d2fa4f218ad5302dee20bd4cd90e6cd33be4 Mon Sep 17 00:00:00 2001 From: RogerWork Date: Mon, 16 Jun 2025 16:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=9B=B4=E6=96=B0=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/storage/storage.js | 12 +++++ src/views/product/index.vue | 95 +++++++++++++++++++++++++++++++++++-- 2 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 src/storage/storage.js diff --git a/src/storage/storage.js b/src/storage/storage.js new file mode 100644 index 0000000..7111106 --- /dev/null +++ b/src/storage/storage.js @@ -0,0 +1,12 @@ +export const storage = { + set(key, value) { + localStorage.setItem(key, JSON.stringify(value)); + }, + get(key) { + const value = localStorage.getItem(key); + return value ? JSON.parse(value) : null; + }, + remove(key) { + localStorage.removeItem(key); + } +} \ No newline at end of file diff --git a/src/views/product/index.vue b/src/views/product/index.vue index 25e3823..51719a8 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -1,7 +1,9 @@ @@ -162,6 +245,7 @@ onMounted( - + - + + +