From 6d67ebff951b08a55cd617a05bcc9591c16118dd Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Mon, 8 Jun 2020 23:16:27 +0200 Subject: [PATCH] - Added edit spell component and started working on edit system --- .../src/components/spells/edit-spell-card.vue | 75 +++++++++++++++++++ client/src/components/spells/spell-card.vue | 41 ++++------ client/src/components/spells/spells-list.vue | 27 +++++-- client/src/pages/spells-page.vue | 4 +- client/src/pages/world-page.vue | 67 ++--------------- client/src/routes.js | 12 +-- 6 files changed, 124 insertions(+), 102 deletions(-) create mode 100644 client/src/components/spells/edit-spell-card.vue diff --git a/client/src/components/spells/edit-spell-card.vue b/client/src/components/spells/edit-spell-card.vue new file mode 100644 index 0000000..87a10ee --- /dev/null +++ b/client/src/components/spells/edit-spell-card.vue @@ -0,0 +1,75 @@ + + + + + \ No newline at end of file diff --git a/client/src/components/spells/spell-card.vue b/client/src/components/spells/spell-card.vue index c45b5c1..ac5ed6c 100644 --- a/client/src/components/spells/spell-card.vue +++ b/client/src/components/spells/spell-card.vue @@ -1,31 +1,28 @@ @@ -35,26 +32,20 @@ export default { name: 'spell-card', props: { - // Model validation - id: Number, - name: String, - description: String, - level: Number, - charge: Number, - cost: String, - schools: Array, - ingredients: Array, - variables: Array, + spell: Object, }, data() { return { - main_school: this.schools[0].name, + main_school: this.spell.schools[0].name, } }, created() { this.main_school = this.main_school.toLowerCase(); }, methods: { + editSpell(spell) { + this.$emit('editSpell', spell) + } }, } diff --git a/client/src/components/spells/spells-list.vue b/client/src/components/spells/spells-list.vue index 6bf2a3a..0b159e8 100644 --- a/client/src/components/spells/spells-list.vue +++ b/client/src/components/spells/spells-list.vue @@ -1,12 +1,16 @@ diff --git a/client/src/pages/world-page.vue b/client/src/pages/world-page.vue index 667643f..bc8af31 100644 --- a/client/src/pages/world-page.vue +++ b/client/src/pages/world-page.vue @@ -1,66 +1,6 @@ @@ -71,4 +11,7 @@ export default { \ No newline at end of file +.world-page{ + position: relative; +} + \ No newline at end of file diff --git a/client/src/routes.js b/client/src/routes.js index 72cfdb0..0bb4836 100644 --- a/client/src/routes.js +++ b/client/src/routes.js @@ -2,9 +2,9 @@ // Pages -import index from "./pages/index-page"; -import spells from "./pages/spells-page"; -import world from "./pages/world-page"; +import Index from "./pages/index-page"; +import Spells from "./pages/spells-page"; +import World from "./pages/world-page"; // Routes const routes = [ @@ -12,13 +12,13 @@ const routes = [ path: "*", redirect: "/", }, { - path: '/', component: index, + path: '/', component: Index, }, { - path: '/spells', component: spells, + path: '/spells', component: Spells, }, { - path: '/world', component: world, + path: '/world', component: World, } ];