- starting add Categories

- improved layout drawer
This commit is contained in:
Paolo Arena
2019-01-05 20:11:41 +01:00
parent f01a3445f7
commit fd2321cd20
21 changed files with 706 additions and 91 deletions

View File

@@ -0,0 +1,3 @@
.mycard {
visibility: hidden;
}

View File

@@ -0,0 +1,62 @@
import Vue from 'vue'
import { Component } from 'vue-property-decorator'
import { GlobalStore } from '@store'
import VueIdb from 'vue-idb'
Vue.use(VueIdb)
require('./category.scss')
@Component({})
export default class Category extends Vue {
idb = null
category: string = ''
$t: any
created() {
this.createdb()
this.caricaCat()
}
createdb() {
// Inserisci la Categoria nel DB
this.idb = new VueIdb({
version: 1,
database: 'test',
schemas: [
{ categories: '++id, sub_categ_id, descr_it' }
]
})
}
caricaCat() {
let mythis = this
this.idb.open().then(function () {
return mythis.idb.categories
.toArray()
}).then(function () {
console.log('FINE LOAD')
})
}
insertCategory(): any {
let mythis = this
this.idb.open().then(function () {
console.log('Inserisci Cat: ', mythis.category)
return mythis.idb.categories.add({ descr_it: mythis.category })
}).then(function () {
console.log('FINE')
})
}
}

View File

@@ -0,0 +1,16 @@
<template>
<q-page>
<div class="panel">
<p class="caption">Category:</p>
<q-input v-model="category" inverted float-label="Inserisci la Categoria"
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
v-on:keyup.enter="insertCategory"/>
</div>
</q-page>
</template>
<script lang="ts" src="./category.ts">
</script>