Created
May 30, 2018 21:05
-
-
Save jameshulse/08a84f6ed2bd7156fc3b54af861ec402 to your computer and use it in GitHub Desktop.
Revisions
-
jameshulse created this gist
May 30, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <template> <div> <model-overview :title="title" :models="models" @select="changeModel" @add="createModel" /> <complex-form v-if="selectedModel" @update="updateModel" :schema="formSchema" /> <slot v-else name="emptyState" /> </div> </template> <script> export default { name: 'FormPage', props: ['api'], methods: { createModel() { this.api.create(); }, ... } }; </script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <template> <form-page title="Page One" :api="api" > <template slot="empty-state"> Empty state for page one </template> </form-page> </template> <script> export default { data() { return { api: { create() { axios.post('/model-one/') }, }; } }; </script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <template> <form-page title="Page Two" :api="api" > <template slot="empty-state"> Empty state for page two </template> </form-page> </template> <script> export default { data() { return { api: { create() { axios.post('/model-one/') }, }; } }; </script>