Skip to content

Commit 47a5811

Browse files
committed
Fix npm package and update README.md
1 parent c15f881 commit 47a5811

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ And then in your App.vue file:
8585
8686
<script>
8787
// Import necessary components and classes
88-
import FlowForm from 'vue-flow-form/src/components/FlowForm'
89-
import QuestionModel, { QuestionType, ChoiceOption } from 'vue-flow-form/src/models/QuestionModel'
88+
import FlowForm, { QuestionModel, QuestionType, ChoiceOption } from '@ditdot-dev/vue-flow-form'
9089
9190
export default {
9291
name: 'example',
@@ -111,6 +110,12 @@ And then in your App.vue file:
111110
}
112111
}
113112
</script>
113+
<style>
114+
/* Import Vue Flow Form base CSS */
115+
@import '~@ditdot-dev/vue-flow-form/dist/vue-flow-form.css';
116+
/* Import Vue Flow Form theme CSS (optional) */
117+
@import '~@ditdot-dev/vue-flow-form/dist/vue-flow-form.theme.css';
118+
</style>
114119
```
115120

116121
## JavaScript via CDN
@@ -144,11 +149,11 @@ var app = new Vue({
144149
data: function() {
145150
return {
146151
questions: [
147-
new FlowForm.default.QuestionModel({
152+
new FlowForm.QuestionModel({
148153
question: '...',
149-
type: FlowForm.default.QuestionType.MultipleChoice,
154+
type: FlowForm.QuestionType.MultipleChoice,
150155
options: [
151-
new FlowForm.default.ChoiceOption({
156+
new FlowForm.ChoiceOption({
152157
label: '...'
153158
})
154159
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@ditdot-dev/vue-flow-form",
33
"author": "DITDOT",
44
"description": "Create conversational conditional-logic forms with Vue.js.",
5-
"version": "1.0.0",
5+
"version": "1.0.3",
66
"private": false,
77
"repository": {
88
"type": "git",

src/components/QuestionTypes/MultipleChoiceType.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
v-on:click="toggleAnswer(option)"
77
v-bind:class="{'f-selected': option.selected}"
88
v-bind:key="'m' + index"
9-
v-bind:aria-label="language.ariaMultipleChoice|replace(':letter', getToggleKey(index))"
9+
v-bind:aria-label="getLabel(index)"
1010
role="option"
1111
>
1212
<span class="f-key">{{ getToggleKey(index) }}</span>
@@ -116,6 +116,10 @@
116116
}
117117
},
118118
119+
getLabel(index) {
120+
return this.language.ariaMultipleChoice.replace(':letter', this.getToggleKey(index))
121+
},
122+
119123
getToggleKey(index) {
120124
const key = 65 + index
121125

src/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ if (GlobalVue) {
2626
}
2727

2828
// To allow use as module (npm/webpack/etc.) export component
29-
export default {
30-
FlowForm,
29+
export default FlowForm
30+
31+
export {
3132
QuestionModel,
3233
QuestionType,
3334
ChoiceOption

0 commit comments

Comments
 (0)