moved the data to js file
This commit is contained in:
parent
58af8f2ab7
commit
b2af5d2a78
2 changed files with 8 additions and 9 deletions
|
@ -1,21 +1,14 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Li from './Li.js';
|
import Li from './Li.js';
|
||||||
import AddTodoForm from './AddtodoForm.js';
|
import AddTodoForm from './AddtodoForm.js';
|
||||||
|
|
||||||
import 'bootstrap/dist/css/bootstrap.css';
|
import 'bootstrap/dist/css/bootstrap.css';
|
||||||
|
import dotoJson from '../server/data/todolist.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TodoList extends React.Component {
|
class TodoList extends React.Component {
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
todoList : [
|
todoList : dotoJson,
|
||||||
{id: 123, todo: 'Clean the bathroom' , at:'2020', isDone: false},
|
|
||||||
{id: 124, todo: 'Buy Milk', at:'2019', isDone: true},
|
|
||||||
{id: 129, todo: 'Walk the dog' , at:'2018', isDone: false}
|
|
||||||
],
|
|
||||||
nextTodoValue: '',
|
nextTodoValue: '',
|
||||||
isCheckAll: false,
|
isCheckAll: false,
|
||||||
checkAllToggleName: 'checkAll'
|
checkAllToggleName: 'checkAll'
|
||||||
|
|
6
src/server/data/todolist.js
Normal file
6
src/server/data/todolist.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
const dotoJson = [
|
||||||
|
{id: 123, todo: 'Clean the bathroom' , at:'2020', isDone: false},
|
||||||
|
{id: 124, todo: 'Buy Milk', at:'2019', isDone: true},
|
||||||
|
{id: 129, todo: 'Walk the dog' , at:'2018', isDone: false}
|
||||||
|
]
|
||||||
|
export default dotoJson
|
Loading…
Reference in a new issue