Skip to content

Commit

Permalink
Rename to recommended pattern, no single-name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Richter committed Apr 11, 2018
1 parent 1acb088 commit 4ebaffe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div class="ui fluid card" :class="{ 'green' :todo.done }">
<!-- yoda, ternary: :class="todo.done ? 'green' : 'red'" -->


<!--View Mode-->
<div class="content" v-show="!isEditing">
<div class="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
// no arrow functions! needs this context to vue instance
created: function () {
console.log('TodoCreate.vue component was created')
console.log('TodoItemAdd.vue component was created')
},
}
</script>
24 changes: 17 additions & 7 deletions src/components/ListView/_ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
</div>

<!-- v-for over array with key, v-bind todo -->
<todo v-for="(todo, index) in todos" :key="index"
<todo-item v-for="(todo, index) in todos" :key="index"
@delete-todo="deleteTodo"
@complete-todo="completeTodo"
:todo.sync="todo" />
:todo="todo" />

<!-- v-on emitted events -->
<create-todo @create-todo="createTodo"></create-todo>
<todo-item-add @create-todo="createTodo"></todo-item-add>
</div>
</template>

<script type="text/javascript">
import sweetalert from 'sweetalert'
import Todo from './Todo.vue'
import CreateTodo from './TodoCreate.vue'
import TodoItem from './TodoItem.vue'
import TodoItemAdd from './TodoItemAdd.vue'
import { mapState, mapMutations } from 'vuex'
// Todo: use absolute path src/ as root https://github.com/parcel-bundler/parcel/pull/850
Expand All @@ -39,11 +39,21 @@
export default {
name: 'ListView',
components: {
Todo,
CreateTodo,
TodoItem,
TodoItemAdd,
TheHeader,
},
props: {
status: {
type: String,
required: true,
validator: function (value) {
return ['syncing', 'error'].indexOf(value) !== -1
},
},
},
/** Moved to store.js -> computed **/
// data() {
// return {
Expand Down

0 comments on commit 4ebaffe

Please sign in to comment.