Skip to content

Commit 5bd5e2f

Browse files
committed
Update examples (add ESLint rules and npm instructions)
1 parent 741ef64 commit 5bd5e2f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

examples/questionnaire/Example.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
import FlowForm from '../../src/components/FlowForm.vue'
6969
import QuestionModel, { QuestionType, ChoiceOption } from '../../src/models/QuestionModel'
7070
import LanguageModel from '../../src/models/LanguageModel'
71+
// If using the npm package, use the following line instead of the ones above.
72+
// import FlowForm, { QuestionModel, QuestionType, ChoiceOption, LanguageModel } from '@ditdot-dev/vue-flow-form'
7173
7274
export default {
7375
name: 'example',
@@ -155,6 +157,7 @@
155157
}),
156158
new QuestionModel({
157159
id: 'break_1',
160+
/* eslint-disable-next-line no-unused-vars */
158161
content(h) {
159162
return <span>
160163
<span class="fh2">Awesome, thank you. 🙏</span>
@@ -188,6 +191,7 @@
188191
}),
189192
new QuestionModel({
190193
id: 'path_a',
194+
/* eslint-disable-next-line no-unused-vars */
191195
content(h) {
192196
return <span>
193197
<span class="fh2">Excellent choice! 🥳</span>
@@ -242,11 +246,13 @@
242246
}
243247
},
244248
249+
/* eslint-disable-next-line no-unused-vars */
245250
onComplete(completed, questionList) {
246251
// This method is called whenever the "completed" status is changed.
247252
this.completed = completed
248253
},
249254
255+
/* eslint-disable-next-line no-unused-vars */
250256
onSubmit(questionList) {
251257
// This method will only be called if you don't override the
252258
// completeButton slot.
@@ -256,6 +262,7 @@
256262
onSendData() {
257263
this.submitted = true
258264
265+
/* eslint-disable-next-line no-unused-vars */
259266
const data = this.getData()
260267
/*
261268
You can use Fetch API to send the data to your server, eg.:
@@ -296,4 +303,7 @@
296303

297304
<style lang="css">
298305
@import './branding.css';
306+
/* If using the npm package, use the following lines instead of the one above */
307+
/* @import '~@ditdot-dev/vue-flow-form/dist/vue-flow-form.css'; */
308+
/* @import '~@ditdot-dev/vue-flow-form/dist/vue-flow-form.theme.css'; */
299309
</style>

examples/quiz/Example.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
import FlowForm from '../../src/components/FlowForm.vue'
6767
import QuestionModel, { QuestionType, ChoiceOption} from '../../src/models/QuestionModel'
6868
import LanguageModel from '../../src/models/LanguageModel'
69+
// If using the npm package, use the following line instead of the ones above.
70+
// import FlowForm, { QuestionModel, QuestionType, ChoiceOption, LanguageModel } from '@ditdot-dev/vue-flow-form'
6971
7072
export default {
7173
name: 'example',
@@ -94,6 +96,7 @@
9496
new QuestionModel({
9597
id: 'start',
9698
subtitle: '8 questions',
99+
/* eslint-disable-next-line no-unused-vars */
97100
content(h) {
98101
return <span>
99102
<span class="fh2">How much do you know about forms?</span>
@@ -199,6 +202,7 @@
199202
]
200203
}),
201204
new QuestionModel({
205+
/* eslint-disable-next-line no-unused-vars */
202206
content(h) {
203207
return <span>
204208
<span class="fh2">Excellent! You are halfway through.</span>
@@ -297,14 +301,15 @@
297301
}
298302
},
299303
methods: {
304+
/* eslint-disable-next-line no-unused-vars */
300305
onComplete(completed, questionList) {
301306
// This method is called whenever the "completed" status is changed.
302307
this.completed = completed
303308
},
304309
305310
arrayEquals(a, b) {
306-
return Array.isArray(a) &&Array.isArray(b) && a.length === b.length &&
307-
a.every((val, index) => val === b[index])
311+
return Array.isArray(a) && Array.isArray(b) && a.length === b.length &&
312+
a.every((val, index) => val === b[index])
308313
},
309314
310315
calculateScore() {
@@ -335,4 +340,7 @@
335340
336341
<style lang="css">
337342
@import './branding.css';
343+
/* If using the npm package, use the following lines instead of the one above */
344+
/* @import '~@ditdot-dev/vue-flow-form/dist/vue-flow-form.css'; */
345+
/* @import '~@ditdot-dev/vue-flow-form/dist/vue-flow-form.theme.css'; */
338346
</style>

0 commit comments

Comments
 (0)