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