56 lines
651 B
JavaScript
56 lines
651 B
JavaScript
import { psychForm } from "../assets/forms.js";
|
|
|
|
import Form from "./form.js";
|
|
import Range from "./range.js";
|
|
|
|
|
|
const Main =
|
|
{
|
|
components: {
|
|
Form
|
|
},
|
|
|
|
setup()
|
|
{
|
|
const state = Vue.ref(0);
|
|
|
|
function showForm() {
|
|
state.value = 1;
|
|
}
|
|
|
|
function submit() {
|
|
state.value = 2;
|
|
}
|
|
|
|
return { psychForm, state, showForm, submit };
|
|
},
|
|
|
|
template: `
|
|
<div>
|
|
|
|
<div v-if="state == 0">
|
|
|
|
<button class="next-button button" @click="showForm">
|
|
|
|
Start
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<Form v-else-if="state == 1" v-bind="psychForm" :submit="submit" />
|
|
|
|
<div v-else>Result!</div>
|
|
|
|
</div>
|
|
`
|
|
}
|
|
|
|
export default Main;
|
|
|
|
/*
|
|
|
|
Notes...
|
|
|
|
*/
|
|
|