Commit 5a0feaa9 authored by esatakpunar's avatar esatakpunar

single expand get set

parent 2544c632
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
"dialogHeaders", "dialogHeaders",
"productList", "productList",
"filteredProductList", "filteredProductList",
"singleExpand", "getSingleExpand",
"getExpanded", "getExpanded",
"dialog", "dialog",
"loading", "loading",
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
this.setOptions(data); this.setOptions(data);
}, },
}, },
expanded: { expanded: {
get() { get() {
return this.getExpanded; return this.getExpanded;
...@@ -48,6 +49,15 @@ export default { ...@@ -48,6 +49,15 @@ export default {
this.setExpanded(data); this.setExpanded(data);
}, },
}, },
singleExpand: {
get() {
return this.getSingleExpand;
},
set(data) {
this.setSingleExpand(data);
},
},
}, },
methods: { methods: {
...mapActions("products", [ ...mapActions("products", [
...@@ -59,6 +69,7 @@ export default { ...@@ -59,6 +69,7 @@ export default {
"saveProduct", "saveProduct",
"editProduct", "editProduct",
"setExpanded", "setExpanded",
"setSingleExpand",
"setOptions", "setOptions",
]), ]),
}, },
...@@ -171,7 +182,6 @@ export default { ...@@ -171,7 +182,6 @@ export default {
v-model="singleExpand" v-model="singleExpand"
label="Single expand" label="Single expand"
class="mt-2" class="mt-2"
@change="toggleSingleExpand"
></v-switch> ></v-switch>
</v-toolbar> </v-toolbar>
......
...@@ -25,18 +25,19 @@ export default { ...@@ -25,18 +25,19 @@ export default {
}); });
}, },
toggleSingleExpand({ commit }) {
commit("setSingleExpand");
},
setOptions({ commit, dispatch }, data) { setOptions({ commit, dispatch }, data) {
commit("setOptions", data); commit("setOptions", data);
dispatch("fetchProductData"); dispatch("fetchProductData");
}, },
setExpanded({ commit }, data) { setExpanded({ commit }, data) {
commit("setExpanded", data); commit("setExpanded", data);
}, },
setSingleExpand({ commit }, data) {
commit("setSingleExpand", data);
},
closeDialog({ commit }) { closeDialog({ commit }) {
commit("setDialog", false); commit("setDialog", false);
}, },
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
productList(state) { productList(state) {
return state.productList; return state.productList;
}, },
singleExpand(state) { getSingleExpand(state) {
return state.singleExpand; return state.singleExpand;
}, },
getExpanded(state) { getExpanded(state) {
......
...@@ -4,6 +4,7 @@ export default { ...@@ -4,6 +4,7 @@ export default {
}, },
setSingleExpand(state) { setSingleExpand(state) {
state.singleExpand = !state.singleExpand; state.singleExpand = !state.singleExpand;
return state.singleExpand;
}, },
setExpanded(state) { setExpanded(state) {
return state.expanded; return state.expanded;
......
...@@ -2,7 +2,7 @@ export default () => ({ ...@@ -2,7 +2,7 @@ export default () => ({
productList: [], productList: [],
expanded: [], expanded: [],
filteredProductList: [], filteredProductList: [],
singleExpand: true, singleExpand: false,
editedIndex: -1, editedIndex: -1,
editedItem: {}, editedItem: {},
dialog: false, dialog: false,
......
...@@ -762,6 +762,17 @@ ...@@ -762,6 +762,17 @@
"image": "https://picsum.photos/536/354", "image": "https://picsum.photos/536/354",
"productDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse finibus leo eros, et sodales dui rhoncus vitae. Proin porttitor maximus maximus. Duis quis massa ", "productDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse finibus leo eros, et sodales dui rhoncus vitae. Proin porttitor maximus maximus. Duis quis massa ",
"id": "mjBZFkk" "id": "mjBZFkk"
},
{
"productName": "Iphone 14",
"type": "Phone",
"productMaterial": "Steel",
"department": "Electronics",
"color": "red",
"price": "1000.00",
"image": "https://assets.mmsrg.com/isr/166325/c1/-/ASSET_MMS_89722915/mobile_786_587_png/APPLE-iPhone-11-128GB-Ak%C4%B1ll%C4%B1-Telefon-Siyah",
"productDescription": " Ürün Tipi: Akıllı Telefon İşletim Sistemi: iOS 13 İşlemci: A13 Bionic Çip Bellek Kapasitesi: 128 GB Arttırılabilir Hafıza: Hayır RAM Bellek Boyutu: 4 GB Sensörler: Barometre, Jiroskop, Pusula, Yakınlık Sensörü, Ortam Işığı Sensörü, İvmeölçer ",
"id": "tol9bOj"
} }
], ],
"customers": [ "customers": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment