This repository was archived by the owner on Oct 17, 2023. It is now read-only.
File tree 6 files changed +10
-41
lines changed
6 files changed +10
-41
lines changed Original file line number Diff line number Diff line change 18
18
<div class =" content" v-if =" item != 'images' && item != 'thumbnail' && !editState" >
19
19
{{ controlData.data[controlData.detaiIndex]![item] }}
20
20
</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]"
22
23
:alt =" controlData.data[controlData.detaiIndex]?.title" >
23
24
</el-descriptions-item >
24
25
</el-descriptions >
25
26
</el-drawer >
26
27
</template >
27
28
28
29
<script setup lang="ts">
29
- import { computed , ref } from ' vue'
30
+ import { ref } from ' vue'
30
31
import { ElButton , ElDrawer } from ' element-plus'
31
32
import { useControlData } from ' @/stores/useControlData' ;
32
33
@@ -48,7 +49,7 @@ const saveNewVal = () => {
48
49
for (let i = 0 ; i < domArr .length ; i ++ )
49
50
controlData .editItem (i , (domArr [i ] as HTMLInputElement ).value )
50
51
console .log (controlData );
51
-
52
+
52
53
changeEditState ()
53
54
}
54
55
</script >
Original file line number Diff line number Diff line change @@ -31,16 +31,15 @@ const js = await res.json();
31
31
32
32
<script setup lang='ts'>
33
33
import DeleteBut from ' ./DeleteBut.vue'
34
- import { ref , reactive , computed } from ' vue'
34
+ import { ref , computed } from ' vue'
35
35
import { useControlData } from ' @/stores/useControlData' ;
36
36
37
-
38
- let json = ref (js )
39
37
let currentPage = ref (1 )
40
38
41
39
const 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 )
44
43
45
44
controlData .$subscribe ((mutation , state ) => {
46
45
json .value = controlData .data
Original file line number Diff line number Diff line change @@ -16,6 +16,4 @@ APP.use(router);
16
16
APP . use ( ElementPlus ) ;
17
17
APP . use ( pinia ) ;
18
18
19
- const whiteList = [ '/' ] ;
20
-
21
19
APP . 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' ;
2
2
import { defineStore } from 'pinia' ;
3
3
4
4
interface Data {
Original file line number Diff line number Diff line change 2
2
<div class =" body" >
3
3
<div class =" title" >title</div >
4
4
<Table ></Table >
5
- <Detail :visible = " show " :data = " data " ></Detail >
5
+ <Detail ></Detail >
6
6
</div >
7
7
</template >
8
8
9
9
<script lang="ts" setup>
10
- import { ref , reactive , toRefs } from ' vue'
11
- import { useControlData } from ' @/stores/useControlData' ;
12
10
import Table from ' @/components/Table.vue' ;
13
11
import 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 )
33
12
</script >
34
13
35
14
You can’t perform that action at this time.
0 commit comments