<script setup lang="ts">
import { ref } from "vue";
import { usePhotoDataListStore } from "@/store/photoStore";
const store = usePhotoDataListStore();
//import PhotoStoreUtils from "@/utils/storeUtils/PhotoStoreUtils";//只要把这段代码打开就白屏
const title = ref("Hello");
function addPiniaData() {
const time = new Date();
const item = {
_id: time.getTime(),
name: "Pinia",
} as PhotoItem;
store.saveOrUpdatePhotoItem(item);
}
function queryPiniaData() {
const photoDataList = store.getUploadPhotoDataList();
console.log("queryPiniaData===photoDataList=", photoDataList);
}
function deletePiniaData() {
store.clearPhotoItems();
console.log("deletePiniaData===deletePiniaData=");
}
</script>