corretto altro ts...
ora manca ancora il vuelidate
This commit is contained in:
3
src/root/home/home.scss
Normal file
3
src/root/home/home.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
.mycard {
|
||||
visibility: hidden;
|
||||
}
|
||||
91
src/root/home/home.ts
Normal file
91
src/root/home/home.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Watch, Prop } from 'vue-property-decorator'
|
||||
import { GlobModule } from '@/store/modules/glob'
|
||||
|
||||
require('./home.scss')
|
||||
|
||||
@Component({
|
||||
|
||||
})
|
||||
export default class Home extends Vue {
|
||||
text: string = ''
|
||||
visibile: boolean = false
|
||||
cardvisible: string = 'hidden'
|
||||
displaycard: string = 'block'
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
console.log('created...')
|
||||
this.initprompt()
|
||||
}
|
||||
|
||||
mystilecard() {
|
||||
return {
|
||||
visibility: this.cardvisible,
|
||||
display: this.displaycard
|
||||
}
|
||||
}
|
||||
|
||||
get conta() {
|
||||
return GlobModule.conta
|
||||
}
|
||||
|
||||
set conta(valore) {
|
||||
GlobModule.setConta(valore)
|
||||
var my = this.$q.i18n.lang
|
||||
this.showNotification(String(my))
|
||||
}
|
||||
|
||||
showNotification(msg: string) {
|
||||
this.$q.notify(msg)
|
||||
}
|
||||
|
||||
initprompt() {
|
||||
window.addEventListener('beforeinstallprompt', function (event) {
|
||||
console.log('******************************** beforeinstallprompt fired')
|
||||
event.preventDefault()
|
||||
console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
test_fetch() {
|
||||
fetch('https:/httpbin.org/post', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json'
|
||||
},
|
||||
// mode: 'no-cors',
|
||||
mode: 'cors',
|
||||
body: JSON.stringify({ message: 'Does this work?' })
|
||||
}).then(function (response) {
|
||||
console.log(response)
|
||||
if (response)
|
||||
return response.json()
|
||||
else
|
||||
return null
|
||||
}).then(function (data) {
|
||||
console.log(data)
|
||||
}).catch(function (err) {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
openCreatePostModal() {
|
||||
console.log('APERTO ! openCreatePostModal')
|
||||
|
||||
this.conta = this.conta + 1
|
||||
|
||||
this.visibile = !this.visibile
|
||||
|
||||
if (this.visibile) {
|
||||
this.displaycard = 'block'
|
||||
this.cardvisible = 'visible'
|
||||
} else {
|
||||
this.displaycard = 'block'
|
||||
this.cardvisible = 'hidden'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
38
src/root/home/home.vue
Normal file
38
src/root/home/home.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template >
|
||||
<q-page class="flex flex-center">
|
||||
<img alt="Quasar logo" src="~assets/quasar-logo-full.svg">
|
||||
|
||||
<q-btn round color="blue" icon="add" id="shareimagebutton" @click="openCreatePostModal">
|
||||
<q-spinner-facebook slot="loading"/>
|
||||
</q-btn>
|
||||
|
||||
<q-field
|
||||
icon="wifi"
|
||||
:count="10"
|
||||
helper="Some helper"
|
||||
>
|
||||
<br>Conta = {{ conta }}
|
||||
</q-field>
|
||||
|
||||
<!--<q-btn
|
||||
@click="showNotification"
|
||||
color="primary"
|
||||
label="Mostra notifica"
|
||||
/>-->
|
||||
|
||||
<q-card id="mycard" class="mycard" :style="mystilecard">
|
||||
<q-card-title>
|
||||
Card Title
|
||||
</q-card-title>
|
||||
<q-card-separator/>
|
||||
<q-card-main>
|
||||
Card Content
|
||||
</q-card-main>
|
||||
</q-card>
|
||||
|
||||
</q-page>
|
||||
|
||||
|
||||
</template>
|
||||
<script lang="ts" src="./home.ts">
|
||||
</script>
|
||||
Reference in New Issue
Block a user