@@ -12,6 +12,8 @@ Create conversational conditional-logic forms with Vue.js.
1212 <img src =" https://www.ditdot.hr/demo/vff/visuals/v-form-green-full-rotate-02.png " alt =" v-form screenshots " >
1313</p >
1414
15+ Starting with v2.0.0, Vue Flow Form has migrated from Vue 2 to ** Vue 3** . If you're looking for README for Vue Flow Form v1.1.7, which works with Vue 2, <a href =" https://github.com/ditdot-dev/vue-flow-form/blob/bc471447a6aadbbda7df9eb950566ed03a0d5e37/README.md " >check it out here</a >.
16+
1517## Live Demos
1618
1719* [ Questionnaire example] ( https://www.ditdot.hr/demo/vff/questionnaire/ )
@@ -98,7 +100,7 @@ And then in your App.vue file:
98100
99101<script >
100102 // Import necessary components and classes
101- import FlowForm , { QuestionModel , QuestionType , ChoiceOption , LanguageModel } from ' @ditdot-dev/vue-flow-form'
103+ import { FlowForm , QuestionModel , QuestionType , ChoiceOption , LanguageModel } from ' @ditdot-dev/vue-flow-form'
102104
103105 export default {
104106 name: ' example' ,
@@ -146,14 +148,14 @@ HTML:
146148<!DOCTYPE html>
147149<html >
148150 <head >
149- <!-- Requires Vue version 2.6 .x -->
150- <script src =" https://cdnjs.cloudflare. com/ajax/libs/ vue/2.6.11/vue.min.js " ></script >
151+ <!-- Requires Vue version 3 .x -->
152+ <script src =" https://unpkg. com/vue@next " ></script >
151153 <!-- Flow Form -->
152- <script src =" https://unpkg.com/@ditdot-dev/vue-flow-form@1.1.7 " ></script >
154+ <script src =" https://unpkg.com/@ditdot-dev/vue-flow-form@2.0.0 " ></script >
153155 <!-- Flow Form base CSS -->
154- <link rel =" stylesheet" href =" https://unpkg.com/@ditdot-dev/vue-flow-form@1.1.7 /dist/vue-flow-form.min.css" >
156+ <link rel =" stylesheet" href =" https://unpkg.com/@ditdot-dev/vue-flow-form@2.0.0 /dist/vue-flow-form.min.css" >
155157 <!-- Optional theme.css -->
156- <link rel =" stylesheet" href =" https://unpkg.com/@ditdot-dev/vue-flow-form@1.1.7 /dist/vue-flow-form.theme-minimal.min.css" >
158+ <link rel =" stylesheet" href =" https://unpkg.com/@ditdot-dev/vue-flow-form@2.0.0 /dist/vue-flow-form.theme-minimal.min.css" >
157159 <!-- Optional font -->
158160 <link rel =" stylesheet" href =" https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;900& ; display=swap" >
159161 </head >
@@ -167,29 +169,31 @@ HTML:
167169JavaScript (content of app.js):
168170
169171``` js
170- var app = new Vue ({
172+ var app = Vue . createApp ({
171173 el: ' #app' ,
172174 template: ' <flow-form v-bind:questions="questions" v-bind:language="language" />' ,
173175 data : function () {
174176 return {
175- language: new FlowForm .LanguageModel ({
177+ language: new VueFlowForm .LanguageModel ({
176178 // Your language definitions here (optional).
177179 // You can leave out this prop if you want to use the default definitions.
178180 }),
179181 questions: [
180- new FlowForm .QuestionModel ({
182+ new VueFlowForm .QuestionModel ({
181183 title: ' Question' ,
182- type: FlowForm .QuestionType .MultipleChoice ,
184+ type: VueFlowForm .QuestionType .MultipleChoice ,
183185 options: [
184- new FlowForm .ChoiceOption ({
186+ new VueFlowForm .ChoiceOption ({
185187 label: ' Answer'
186188 })
187189 ]
188190 })
189191 ]
190192 }
191193 }
192- });
194+ }).component (' FlowForm' , VueFlowForm .FlowForm );
195+
196+ const vm = app .mount (' #app' );
193197```
194198
195199## Changelog
0 commit comments