[Popup.vue] poprawienie rejestracji komponentu
This commit is contained in:
parent
23166284d2
commit
bf48af50c6
@ -1,5 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
//Uruchomienie na windowsie
|
||||||
|
// go run main.go connector_couchdb.go connector_mysql.go models.go views.go
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -48,12 +48,49 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
submit(){
|
submit(){
|
||||||
|
//pobiera dane i wysyla na backend jsona dla karty
|
||||||
|
/*{ "id" : 1,
|
||||||
|
"IsQuestion" : true ,
|
||||||
|
"Blank" :1 ,
|
||||||
|
"texst": "ALA MA KOTA"
|
||||||
|
}*/
|
||||||
|
|
||||||
if (this.$refs.form.validate()){ //valinnaj JS
|
if (this.$refs.form.validate()){ //valinnaj JS
|
||||||
// this.loading = true;
|
// this.loading = true;
|
||||||
console.log("Dodanie do bazy")
|
console.log("Dodanie do bazy")
|
||||||
|
console.log(this.cardText)
|
||||||
|
console.log(this.cardType)
|
||||||
|
var blank = 0
|
||||||
|
if (this.cardText.match(/_/g)){
|
||||||
|
blank = this.cardText.match(/_/g).length;
|
||||||
|
}
|
||||||
|
if (this.cardType === "pytanie" && blank === 0){
|
||||||
|
//walidacja - karta pytanie musi miec min 1 pole puste
|
||||||
|
this.inputRules = [false || 'Karta pytanie musi miec min jedno pole na odpwiedz ( znak podłogi _)'] //info zwrotne w dialogu dla uzytkownika
|
||||||
|
}
|
||||||
|
|
||||||
|
var cardObj = {}
|
||||||
|
if (this.cardType == "pytanie"){
|
||||||
|
cardObj.isQuestion = true
|
||||||
|
}else{
|
||||||
|
cardObj.isQuestion = false
|
||||||
|
}
|
||||||
|
cardObj.blank = blank
|
||||||
|
cardObj.text = this.cardText
|
||||||
|
|
||||||
|
|
||||||
|
axios.get(url_status, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then(function(response){
|
||||||
|
vm.friendlist = response.data;
|
||||||
|
})
|
||||||
|
.catch(function(error){
|
||||||
|
vm.friendlist = "An error occured: " + error;
|
||||||
|
});
|
||||||
this.$emit('cardAdded')
|
this.$emit('cardAdded')
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -46,7 +46,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Popup from'@/components/Popup'
|
||||||
export default {
|
export default {
|
||||||
|
components: { Popup },
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
gentelaman: false,
|
gentelaman: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user