Create conversational conditional-logic forms with Vue.js.
npm install @ditdot-dev/vue-flow-form
shell
clone the repo
$ git clone https://github.com/ditdot-dev/vue-flow-form.git myproject
go into app's directory and install dependencies:
$ cd myproject
`
If you use npm:
`shell
$ npm install
serve with hot reload at localhost:8080 by default.
$ npm run serve
build for production
$ npm run build
`
If you use yarn:
`shell
$ yarn install
serve with hot reload at localhost:8080 by default.
$ yarn serve
build for production
$ yarn build
`
Made with Vue.js
Usage as npm Package
If you don't already have an existing Vue project, the easiest way to create one is to use Vue CLI:
(For issues with Vue 3.13 and CLI 4 check here)
`shell
$ npm install -g @vue/cli
OR
$ yarn global add @vue/cli
`
And then create a project (refer to Vue CLI documentation and issue tracker for potential problems on Windows):
`shell
$ vue create my-project
$ cd my-project
`
To add Vue Flow Form as a dependency to your Vue project, use the following:
`shell
$ npm install @ditdot-dev/vue-flow-form --save
`
And then in your App.vue file:
`html
`
Usage with Plain JavaScript via CDN
HTML:
`html
`
JavaScript (content of app.js):
`js
var app = Vue.createApp({
el: '#app',
template: ' ',
data: function() {
return {
language: new VueFlowForm.LanguageModel({
// Your language definitions here (optional).
// You can leave out this prop if you want to use the default definitions.
}),
questions: [
new VueFlowForm.QuestionModel({
title: 'Question',
type: VueFlowForm.QuestionType.MultipleChoice,
options: [
new VueFlowForm.ChoiceOption({
label: 'Answer'
})
]
})
]
}
}
}).component('FlowForm', VueFlowForm.FlowForm);
const vm = app.mount('#app');
``