Skip to content

Commit e5f1b37

Browse files
committed
Add Vue 3 migration related changes
1 parent a3c28be commit e5f1b37

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ And then in your App.vue file:
9898

9999
<script>
100100
// Import necessary components and classes
101-
import FlowForm, { QuestionModel, QuestionType, ChoiceOption, LanguageModel } from '@ditdot-dev/vue-flow-form'
101+
import { FlowForm, QuestionModel, QuestionType, ChoiceOption, LanguageModel } from '@ditdot-dev/vue-flow-form'
102102
103103
export default {
104104
name: 'example',
@@ -146,14 +146,14 @@ HTML:
146146
<!DOCTYPE html>
147147
<html>
148148
<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>
149+
<!-- Requires Vue version 3.x -->
150+
<script src="https://unpkg.com/vue@next"></script>
151151
<!-- Flow Form -->
152-
<script src="https://unpkg.com/@ditdot-dev/vue-flow-form@1.1.7"></script>
152+
<script src="https://unpkg.com/@ditdot-dev/vue-flow-form@2.0.0"></script>
153153
<!-- 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">
154+
<link rel="stylesheet" href="https://unpkg.com/@ditdot-dev/vue-flow-form@2.0.0/dist/vue-flow-form.min.css">
155155
<!-- 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">
156+
<link rel="stylesheet" href="https://unpkg.com/@ditdot-dev/vue-flow-form@2.0.0/dist/vue-flow-form.theme-minimal.min.css">
157157
<!-- Optional font -->
158158
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;900&amp;display=swap">
159159
</head>
@@ -167,29 +167,31 @@ HTML:
167167
JavaScript (content of app.js):
168168

169169
```js
170-
var app = new Vue({
170+
var app = Vue.createApp({
171171
el: '#app',
172172
template: '<flow-form v-bind:questions="questions" v-bind:language="language" />',
173173
data: function() {
174174
return {
175-
language: new FlowForm.LanguageModel({
175+
language: new VueFlowForm.LanguageModel({
176176
// Your language definitions here (optional).
177177
// You can leave out this prop if you want to use the default definitions.
178178
}),
179179
questions: [
180-
new FlowForm.QuestionModel({
180+
new VueFlowForm.QuestionModel({
181181
title: 'Question',
182-
type: FlowForm.QuestionType.MultipleChoice,
182+
type: VueFlowForm.QuestionType.MultipleChoice,
183183
options: [
184-
new FlowForm.ChoiceOption({
184+
new VueFlowForm.ChoiceOption({
185185
label: 'Answer'
186186
})
187187
]
188188
})
189189
]
190190
}
191191
}
192-
});
192+
}).component('FlowForm', VueFlowForm.FlowForm);
193+
194+
const vm = app.mount('#app');
193195
```
194196

195197
## Changelog

0 commit comments

Comments
 (0)