From fc355ad4179b7c528d4e3484769cc1eadb61a4ff Mon Sep 17 00:00:00 2001 From: pawlaczyk Date: Sat, 12 Jan 2019 22:34:40 +0100 Subject: [PATCH] =?UTF-8?q?Od=C5=9Bwiezanie=20sortowanych=20danych=20po=20?= =?UTF-8?q?dodaniu=20nowych=20danych?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/app/src/views/Cards.vue | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/frontend/app/src/views/Cards.vue b/frontend/app/src/views/Cards.vue index e27da9f..90f2a80 100644 --- a/frontend/app/src/views/Cards.vue +++ b/frontend/app/src/views/Cards.vue @@ -21,7 +21,7 @@ - + @@ -30,10 +30,10 @@
{{card.text}}
- +
@@ -57,15 +57,26 @@ export default { data(){ return{ cards: [], + visibleCards: [], + lastPropName: "", totalRows: null } }, methods:{ - sortBy(prop){ + sortBy(propName){ //sortowanie po typie karty - this.cards.filter( obj => { - return obj.type === prop - }) + if (propName){ + this.visibleCards = this.cards.filter( obj => { + console.log(obj.type === "answer") + if (obj.type === propName) { + console.log(obj) + return obj + } + }) + }//koniec Id + else{ + this.visibleCards = this.cards + } }, daneZbazy(){ // w linii komend jako admin na Windzie w folderze app @@ -94,6 +105,7 @@ export default { }) this.cards = cardsTmp + this.sortBy(this.lastPropName) }, checkDiference(){ var objectVue = this;