Added drag and drop

This commit is contained in:
2019-05-28 16:22:59 +03:00
commit 7b210b25f2
13 changed files with 11760 additions and 0 deletions

64
src/App.vue Normal file
View File

@@ -0,0 +1,64 @@
<template>
<div id="app">
<Header />
<AddTodo v-on:add-todo="addTodo"/>
<Todos v-bind:todos="todos" v-on:del-todo="deleteTodo" />
</div>
</template>
<script>
import uuid from 'uuid'
import Header from "./components/layout/Header";
import Todos from "./components/Todos";
import AddTodo from "./components/AddTodo";
export default {
name: 'app',
components: {
Header,
Todos,
AddTodo
},
data() {
return {
todos: [
{
id: uuid.v4(),
name: "Что-то, что я собираюсь сделать",
completed: false
},
{
id: uuid.v4(),
name: "Что-то, что я уже сделал",
completed: true
}
]
}
},
methods: {
deleteTodo(id) {
this.todos = this.todos.filter(todo => todo.id !== id);
},
addTodo(n) {
(n !== '' & n !== ' ') && this.todos.push({
id: uuid.v4(),
name: n,
completed: false
})
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css?family=Oswald&display=swap');
#app {
font-family: 'Oswald', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: ;
margin-top: 50px;
}
</style>