- fix: starting the app it doesn't loaded the SingleTodo correctly...
the problem was:
import { SingleTodo } from '@components' // doesn't work:
Resolve :
import { SingleTodo } from '../../SingleTodo' // correct!
This commit is contained in:
@@ -13,9 +13,9 @@ const extendTypescriptToWebpack = (config) => {
|
|||||||
config.resolve
|
config.resolve
|
||||||
.alias
|
.alias
|
||||||
.set('@components', path.resolve(__dirname, 'src/components/index.ts'))
|
.set('@components', path.resolve(__dirname, 'src/components/index.ts'))
|
||||||
.set('@components', path.resolve(__dirname, 'src/components'))
|
// .set('@components', path.resolve(__dirname, 'src/components'))
|
||||||
.set('@views', path.resolve(__dirname, 'src/components/views/index.ts'))
|
.set('@views', path.resolve(__dirname, 'src/components/views/index.ts'))
|
||||||
.set('@views', path.resolve(__dirname, 'src/components/views'))
|
// .set('@views', path.resolve(__dirname, 'src/components/views'))
|
||||||
.set('@src', path.resolve(__dirname, 'src'))
|
.set('@src', path.resolve(__dirname, 'src'))
|
||||||
.set('@icons', path.resolve(__dirname, 'src/assets/icons'))
|
.set('@icons', path.resolve(__dirname, 'src/assets/icons'))
|
||||||
.set('@images', path.resolve(__dirname, 'src/assets/images'))
|
.set('@images', path.resolve(__dirname, 'src/assets/images'))
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<router-link :to="'/'" v-if="$router.currentRoute.meta.backButton">
|
||||||
|
<button>
|
||||||
|
<i>arrow_back</i>
|
||||||
|
</button>
|
||||||
|
</router-link>
|
||||||
|
-->
|
||||||
<q-layout-header>
|
<q-layout-header>
|
||||||
<q-toolbar
|
<q-toolbar
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { Component, Watch } from 'vue-property-decorator'
|
import { Component, Watch } from 'vue-property-decorator'
|
||||||
|
|
||||||
import { SingleCat } from '@components'
|
import { SingleCat } from '../SingleCat'
|
||||||
import { ICategory } from '@src/model'
|
import { ICategory } from '@src/model'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { UserStore } from '@modules'
|
|||||||
|
|
||||||
import { ITodo } from '../../../model/index'
|
import { ITodo } from '../../../model/index'
|
||||||
|
|
||||||
import { SubMenus } from '@components'
|
import { SubMenus } from '../SubMenus'
|
||||||
|
|
||||||
|
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||||
|
|
||||||
import { SingleTodo } from '@components'
|
import { SingleTodo } from '../SingleTodo'
|
||||||
import { ITodo } from '@src/model'
|
import { ITodo } from '@src/model'
|
||||||
|
|
||||||
import { rescodes } from '../../../store/Modules/rescodes'
|
import { rescodes } from '../../../store/Modules/rescodes'
|
||||||
@@ -34,6 +34,8 @@ export default class Todo extends Vue {
|
|||||||
itemDragEnd: any = null
|
itemDragEnd: any = null
|
||||||
selrowid: number = 0
|
selrowid: number = 0
|
||||||
|
|
||||||
|
// @Prop({ required: false }) category: string
|
||||||
|
|
||||||
$refs: {
|
$refs: {
|
||||||
single: SingleTodo[]
|
single: SingleTodo[]
|
||||||
}
|
}
|
||||||
@@ -49,6 +51,7 @@ export default class Todo extends Vue {
|
|||||||
|
|
||||||
getCategory() {
|
getCategory() {
|
||||||
return this.$route.params.category
|
return this.$route.params.category
|
||||||
|
// return this.category
|
||||||
}
|
}
|
||||||
|
|
||||||
change(param) {
|
change(param) {
|
||||||
@@ -242,6 +245,9 @@ export default class Todo extends Vue {
|
|||||||
|
|
||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
|
// Set last category selected
|
||||||
|
localStorage.setItem(rescodes.localStorage.categorySel, this.getCategory())
|
||||||
|
|
||||||
for (let todosKey in rescodes.Todos) {
|
for (let todosKey in rescodes.Todos) {
|
||||||
this.listPriorityLabel.push(rescodes.Todos[todosKey])
|
this.listPriorityLabel.push(rescodes.Todos[todosKey])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export interface IGlobalState {
|
|||||||
mobileMode: boolean
|
mobileMode: boolean
|
||||||
menuCollapse: boolean
|
menuCollapse: boolean
|
||||||
leftDrawerOpen: boolean
|
leftDrawerOpen: boolean
|
||||||
|
category: string
|
||||||
posts: IPost[]
|
posts: IPost[]
|
||||||
listatodo: ITodoList[]
|
listatodo: ITodoList[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export interface IUserState {
|
|||||||
tokens?: IToken[]
|
tokens?: IToken[]
|
||||||
|
|
||||||
verifiedEmail?: boolean
|
verifiedEmail?: boolean
|
||||||
|
categorySel?: string
|
||||||
|
|
||||||
tokenforgot?: string
|
tokenforgot?: string
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
|||||||
import { Component } from 'vue-property-decorator'
|
import { Component } from 'vue-property-decorator'
|
||||||
import { GlobalStore } from '@store'
|
import { GlobalStore } from '@store'
|
||||||
|
|
||||||
import { Logo } from '@components'
|
import { Logo } from '../../components/logo'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { Logo }
|
components: { Logo }
|
||||||
|
|||||||
@@ -27,13 +27,8 @@ export const RouteConfig: VueRouteConfig[] = [
|
|||||||
{
|
{
|
||||||
path: '/todo/:category',
|
path: '/todo/:category',
|
||||||
component: () => import('@/components/todos/todo/todo.vue'),
|
component: () => import('@/components/todos/todo/todo.vue'),
|
||||||
meta: { name: 'Todos' },
|
// props: { category: 'personal' },
|
||||||
children: [
|
meta: { name: 'Todos' }
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
component: () => import('@/components/todos/SingleTodo/SingleTodo.vue')
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/category',
|
path: '/category',
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const state: IGlobalState = {
|
|||||||
mobileMode: false,
|
mobileMode: false,
|
||||||
menuCollapse: true,
|
menuCollapse: true,
|
||||||
leftDrawerOpen: true,
|
leftDrawerOpen: true,
|
||||||
|
category: 'personal',
|
||||||
posts: [],
|
posts: [],
|
||||||
listatodo: [
|
listatodo: [
|
||||||
{namecat: 'personal', description: 'personal'},
|
{namecat: 'personal', description: 'personal'},
|
||||||
@@ -24,6 +25,7 @@ namespace Getters {
|
|||||||
|
|
||||||
const conta = b.read(state => state.conta, 'conta')
|
const conta = b.read(state => state.conta, 'conta')
|
||||||
const listatodo = b.read(state => state.listatodo, 'listatodo')
|
const listatodo = b.read(state => state.listatodo, 'listatodo')
|
||||||
|
const category = b.read(state => state.category, 'category')
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
get conta() {
|
get conta() {
|
||||||
@@ -32,6 +34,10 @@ namespace Getters {
|
|||||||
|
|
||||||
get listaTodo() {
|
get listaTodo() {
|
||||||
return listatodo()
|
return listatodo()
|
||||||
|
},
|
||||||
|
|
||||||
|
get category() {
|
||||||
|
return category()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,9 +52,15 @@ namespace Mutations {
|
|||||||
state.leftDrawerOpen = bool
|
state.leftDrawerOpen = bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setCategorySel(state: IGlobalState, cat: string) {
|
||||||
|
state.category = cat
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
setConta: b.commit(setConta),
|
setConta: b.commit(setConta),
|
||||||
setleftDrawerOpen: b.commit(setleftDrawerOpen)
|
setleftDrawerOpen: b.commit(setleftDrawerOpen),
|
||||||
|
setCategorySel: b.commit(setCategorySel)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ const state: IUserState = {
|
|||||||
repeatPassword: '',
|
repeatPassword: '',
|
||||||
idToken: '',
|
idToken: '',
|
||||||
tokens: [],
|
tokens: [],
|
||||||
verifiedEmail: false
|
verifiedEmail: false,
|
||||||
|
categorySel: 'personal'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -69,6 +70,7 @@ namespace Mutations {
|
|||||||
state.username = data.username
|
state.username = data.username
|
||||||
state.idToken = data.idToken
|
state.idToken = data.idToken
|
||||||
state.verifiedEmail = data.verifiedEmail
|
state.verifiedEmail = data.verifiedEmail
|
||||||
|
state.category = data.categorySel
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
state.tokens = [
|
state.tokens = [
|
||||||
{ access: 'auth', token: data.idToken }
|
{ access: 'auth', token: data.idToken }
|
||||||
@@ -106,6 +108,7 @@ namespace Mutations {
|
|||||||
state.tokens = []
|
state.tokens = []
|
||||||
state.idToken = ''
|
state.idToken = ''
|
||||||
state.verifiedEmail = false
|
state.verifiedEmail = false
|
||||||
|
state.categorySel = 'personal'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
@@ -484,12 +487,14 @@ namespace Actions {
|
|||||||
localStorage.removeItem(rescodes.localStorage.isLogged)
|
localStorage.removeItem(rescodes.localStorage.isLogged)
|
||||||
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
|
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
|
||||||
localStorage.removeItem(rescodes.localStorage.verifiedEmail)
|
localStorage.removeItem(rescodes.localStorage.verifiedEmail)
|
||||||
|
localStorage.removeItem(rescodes.localStorage.categorySel)
|
||||||
|
|
||||||
router.push('/signin')
|
router.push('/signin')
|
||||||
}
|
}
|
||||||
|
|
||||||
function setGlobal() {
|
function setGlobal() {
|
||||||
GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(rescodes.localStorage.leftDrawerOpen) === 'true')
|
GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(rescodes.localStorage.leftDrawerOpen) === 'true')
|
||||||
|
GlobalStore.mutations.setCategorySel(localStorage.getItem(rescodes.localStorage.categorySel))
|
||||||
}
|
}
|
||||||
|
|
||||||
async function autologin (context) {
|
async function autologin (context) {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const rescodes = {
|
|||||||
|
|
||||||
localStorage: {
|
localStorage: {
|
||||||
verifiedEmail: 'vf',
|
verifiedEmail: 'vf',
|
||||||
|
categorySel: 'cs',
|
||||||
isLogged: 'ilog',
|
isLogged: 'ilog',
|
||||||
expirationDate: 'expdate',
|
expirationDate: 'expdate',
|
||||||
leftDrawerOpen: 'ldo',
|
leftDrawerOpen: 'ldo',
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { validations, TSignin } from './signin-validate'
|
|||||||
|
|
||||||
import { validationMixin } from 'vuelidate'
|
import { validationMixin } from 'vuelidate'
|
||||||
|
|
||||||
import { Logo } from '@components'
|
import { Logo } from '../../../components/logo'
|
||||||
|
|
||||||
import router from '@router'
|
import router from '@router'
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { validations, TSignup } from './signup-validate'
|
|||||||
|
|
||||||
import { validationMixin } from 'vuelidate'
|
import { validationMixin } from 'vuelidate'
|
||||||
|
|
||||||
import { Logo } from '@components'
|
import { Logo } from '../../../components/logo'
|
||||||
|
|
||||||
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user