Skip to content

Commit

Permalink
refactor: improve App
Browse files Browse the repository at this point in the history
  • Loading branch information
14nrv committed Oct 24, 2020
1 parent d6f6dc0 commit 5197ff6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ Object.keys(rules).forEach(rule => {
```html
<template lang="pug">
#app.section
form-json(:formFields="jsonFields",
:formName="'userProfil'"
form-json(:btnReset="{value: 'Reset'}",
:btnSubmit="{value: 'Submit'}",
:btnReset="{value: 'Reset'}")
:formFields="jsonFields",
formName="userProfil")
div(slot="slotNameAddedInJsonFields")
p Your slot content
</template>
Expand All @@ -91,11 +91,11 @@ Object.keys(rules).forEach(rule => {
components: {
formJson
},
data: () => ({
jsonFields
}),
mounted () {
this.$root.$on('formSubmitted', values => alert(JSON.stringify(values)))
},
computed: {
jsonFields: () => jsonFields
}
}
</script>
Expand Down
12 changes: 6 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template lang="pug">
#app.section
app-form(:formFields="jsonFields",
formName="userProfil",
app-form(:btnReset="{value: 'Reset'}",
:btnSubmit="{value: 'Submit'}",
:btnReset="{value: 'Reset'}")
:formFields="jsonFields",
formName="userProfil")
div(slot="boxSlot")
.box
article
Expand All @@ -24,11 +24,11 @@ export default {
components: {
appForm: Form
},
data: () => ({
jsonFields
}),
mounted () {
this.$root.$on('formSubmitted', values => alert(JSON.stringify(values)))
},
computed: {
jsonFields: () => jsonFields
}
}
</script>
Expand Down

0 comments on commit 5197ff6

Please sign in to comment.