Home > Mobile >  Todo app: getting todo-items in and out of localstorage
Todo app: getting todo-items in and out of localstorage

Time:03-11

I was trying to get a todo-app to work from localstorage, but don't quite get how it's done. The app works through a Vue.js project with a main.js file where it is linked together from two Classes: App.js and Todo.js (watch below).

import App from "./classes/App.js";
const app = new App();

Here's a list of my findings:

  1. I can only get one of my added todo's into my storage?
  2. I don't seem to be able to return it from my storage? and also when I reload the page it's not getting loaded.

Thank you all ahead of time, it would mean a lot if I got to understand this!

I'll add my CodeSandbox link, since that will be more uncluttered to look at. Link to my CodeSandbox

And here's the two js files anyway: App.js

import Todo from "./Todo.js";

export default class App {
  constructor() {
    console.log("           
  • Related