From 1ea1615a70dd904e47e0e8703183c4ba6741ab21 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 12 Dec 2018 02:37:07 +0000 Subject: [PATCH] Fix bug with event bus --- components/todo-editor.js | 2 +- components/todo-list.js | 2 +- index.html | 4 ++-- scripts.js | 7 +++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/todo-editor.js b/components/todo-editor.js index 4e68d12..4c7559a 100644 --- a/components/todo-editor.js +++ b/components/todo-editor.js @@ -1,4 +1,4 @@ -const bus = new Vue(); +import { bus } from '../scripts.js' const TodoEditor = { template: '#todo-editor-template', diff --git a/components/todo-list.js b/components/todo-list.js index 358625f..bce652e 100644 --- a/components/todo-list.js +++ b/components/todo-list.js @@ -1,4 +1,4 @@ -const bus = new Vue(); +import { bus } from '../scripts.js' const TodoList = { template: '#todo-list-template', diff --git a/index.html b/index.html index 2c0aed7..94c78a1 100644 --- a/index.html +++ b/index.html @@ -56,13 +56,13 @@

Your To-Do's

{{todo.created}} - -
+
diff --git a/scripts.js b/scripts.js index 5f605f8..02fb433 100644 --- a/scripts.js +++ b/scripts.js @@ -1,6 +1,8 @@ import { TodoEditor } from './components/todo-editor.js' import { TodoList } from './components/todo-list.js' +const bus = new Vue(); + new Vue({ el: '#app', components: { @@ -9,9 +11,10 @@ new Vue({ }, template: `
-
` -}) \ No newline at end of file +}) + +export { bus } \ No newline at end of file