Skip to content

Commit 98ba90e

Browse files
committed
Make LanguageModel available when using via npm or CDN
1 parent 5f61998 commit 98ba90e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ And then in your App.vue file:
8282

8383
```html
8484
<template>
85-
<flow-form v-bind:questions="questions" />
85+
<flow-form v-bind:questions="questions" v-bind:language="language" />
8686
</template>
8787

8888
<script>
8989
// Import necessary components and classes
90-
import FlowForm, { QuestionModel, QuestionType, ChoiceOption } from '@ditdot-dev/vue-flow-form'
90+
import FlowForm, { QuestionModel, QuestionType, ChoiceOption, LanguageModel } from '@ditdot-dev/vue-flow-form'
9191
9292
export default {
9393
name: 'example',
@@ -96,6 +96,10 @@ And then in your App.vue file:
9696
},
9797
data() {
9898
return {
99+
language: new LanguageModel({
100+
// Your language definitions here (optional).
101+
// You can leave out this prop if you want to use the default definitions.
102+
}),
99103
questions: [
100104
// QuestioModel array
101105
new QuestionModel({
@@ -138,7 +142,7 @@ HTML:
138142
</head>
139143
<body>
140144
<div id="app">
141-
<flow-form v-bind:questions="questions" />
145+
<flow-form v-bind:questions="questions" v-bind:language="language" />
142146
</div>
143147
<script src="app.js"></script>
144148
</body>
@@ -152,6 +156,10 @@ var app = new Vue({
152156
el: '#app',
153157
data: function() {
154158
return {
159+
language: new FlowForm.LanguageModel({
160+
// Your language definitions here (optional).
161+
// You can leave out this prop if you want to use the default definitions.
162+
}),
155163
questions: [
156164
new FlowForm.QuestionModel({
157165
question: 'Question',

src/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Import vue component
22
import FlowForm from './components/FlowForm.vue'
33
import QuestionModel, { QuestionType, ChoiceOption } from './models/QuestionModel'
4+
import LanguageModel from './models/LanguageModel'
45

56
// Declare install function executed by Vue.use()
67
export function install(Vue) {
@@ -31,5 +32,6 @@ export default FlowForm
3132
export {
3233
QuestionModel,
3334
QuestionType,
34-
ChoiceOption
35+
ChoiceOption,
36+
LanguageModel
3537
}

0 commit comments

Comments
 (0)