This repository was archived by the owner on Oct 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +10
-41
lines changed Expand file tree Collapse file tree 6 files changed +10
-41
lines changed Original file line number Diff line number Diff line change 1818 <div class =" content" v-if =" item != 'images' && item != 'thumbnail' && !editState" >
1919 {{ controlData.data[controlData.detaiIndex]![item] }}
2020 </div >
21- <img v-else-if =" item != 'thumbnail' && !editState" :src =" controlData.data[controlData.detaiIndex]?.images[0]"
21+ <img v-else-if =" item != 'thumbnail' && !editState"
22+ :src =" controlData.data[controlData.detaiIndex]?.images[0]"
2223 :alt =" controlData.data[controlData.detaiIndex]?.title" >
2324 </el-descriptions-item >
2425 </el-descriptions >
2526 </el-drawer >
2627</template >
2728
2829<script setup lang="ts">
29- import { computed , ref } from ' vue'
30+ import { ref } from ' vue'
3031import { ElButton , ElDrawer } from ' element-plus'
3132import { useControlData } from ' @/stores/useControlData' ;
3233
@@ -48,7 +49,7 @@ const saveNewVal = () => {
4849 for (let i = 0 ; i < domArr .length ; i ++ )
4950 controlData .editItem (i , (domArr [i ] as HTMLInputElement ).value )
5051 console .log (controlData );
51-
52+
5253 changeEditState ()
5354}
5455 </script >
Original file line number Diff line number Diff line change @@ -31,16 +31,15 @@ const js = await res.json();
3131
3232<script setup lang='ts'>
3333import DeleteBut from ' ./DeleteBut.vue'
34- import { ref , reactive , computed } from ' vue'
34+ import { ref , computed } from ' vue'
3535import { useControlData } from ' @/stores/useControlData' ;
3636
37-
38- let json = ref (js )
3937let currentPage = ref (1 )
4038
4139const controlData = useControlData ()
42- controlData .setNewVal (json .value .products )
43- json .value = js .products
40+ controlData .setNewVal (js .products )
41+
42+ let json = ref (controlData .data )
4443
4544controlData .$subscribe ((mutation , state ) => {
4645 json .value = controlData .data
Original file line number Diff line number Diff line change @@ -16,6 +16,4 @@ APP.use(router);
1616APP . use ( ElementPlus ) ;
1717APP . use ( pinia ) ;
1818
19- const whiteList = [ '/' ] ;
20-
2119APP . mount ( '#app' ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import { ref , computed } from 'vue' ;
1+ import { ref } from 'vue' ;
22import { defineStore } from 'pinia' ;
33
44interface Data {
Original file line number Diff line number Diff line change 22 <div class =" body" >
33 <div class =" title" >title</div >
44 <Table ></Table >
5- <Detail :visible = " show " :data = " data " ></Detail >
5+ <Detail ></Detail >
66 </div >
77</template >
88
99<script lang="ts" setup>
10- import { ref , reactive , toRefs } from ' vue'
11- import { useControlData } from ' @/stores/useControlData' ;
1210import Table from ' @/components/Table.vue' ;
1311import Detail from ' @/components/Detail.vue' ;
14-
15- const controlData = useControlData ()
16-
17- interface Data {
18- id: number ;
19- title: string ;
20- description: string ;
21- price: number ;
22- discountPercentage: number ;
23- rating: number ;
24- stock: number ;
25- brand: string ;
26- category: string ;
27- thumbnail: string ;
28- images: string [];
29- }
30-
31- let data: Data
32- let show = ref (false )
3312 </script >
3413
3514
You can’t perform that action at this time.
0 commit comments