Skip to content

Commit 356123d

Browse files
updated readme file and package file
1 parent 8f46c7e commit 356123d

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,41 @@ Please look at the souce code of the demo [here](https://github.com/rajeshwarpat
1111

1212
### Steps to use
1313
**Step 1:**
14-
Once you it install, you can import the `SurveyBuilder` as shown below
14+
Once you install it, you can import the `SurveyBuilder` as shown below
1515

1616
`import { SurveyBuilder, SurveyBuilderJson } from 'vue-survey-builder';`
1717

1818
**Step 2:**
19-
Then you can use it in your vue component, as shown below
19+
You can use it in your vue component, as shown below
2020

2121
`<SurveyBuilder :options="SurveyBuilderJson" />`
2222

23-
Here `sampleQuestion` can be the json, which is [here](https://github.com/FissionHQ/vue-survey-builder/blob/master/src/survey-builder.json)
23+
Here `SurveyBuilderJson` is the json, which is used to form question object. Please take a look at it [here](https://github.com/FissionHQ/vue-survey-builder/blob/master/src/survey-builder.json)
2424

25-
This is used to create a new question. We are using this JSON, to build any type of question. Depending on the type of question, only few keys are used in the whole JSON.
25+
Depending on the type of question, only few keys are used in the whole JSON.
2626

2727
**Step 3:**
28-
It emits an event called `add-update-question` with a question object and the type
29-
`this.$root.$emit('add-update-question', question);`
28+
`SurveyBuilder` emits an event called `add-update-question` with a question object `this.$root.$emit('add-update-question', question);`
3029

31-
In your component, keep track of this event to capture it
30+
In your component, keep track of this event to capture the question which is added or updated
3231
````
3332
mounted() {
3433
this.$root.$on('add-update-question', question => {
3534
window.console.log(question);
3635
});
3736
},
3837
````
39-
When you get the object, you can cross check for the `id`, in the list of questions you have. If the `id` exists, then it means there is an update to the question, if the `id` doesn't exist, then you can directly add the question to the list of questions.
38+
Each question will have an `id` which is a UUID field. Once you get the question object form the above event, you can check the `id` of with with the list of questions you have. If the `id` exists, then it means there is an update to the question, if the `id` doesn't exist, then you can directly add that question to the list of questions.
4039
You can refer the sample code in the [demo repository](https://github.com/rajeshwarpatlolla/vue-survey-builder-test/blob/master/src/components/TestSurveyBuilder.vue#L30)
4140

4241
**Step 4:**
43-
You can add your own logic in your component to show the list of question in read only and edit mode. There is a component to show the list of questions, which will be available in the [demo source code](https://github.com/FissionHQ/vue-survey-builder/blob/master/src/QuestionsView.vue). Please use this component called `QuestionsView` in case, you want to show the list of questions added.
42+
You can add your own logic in your component to show the list of question in read only and edit mode. There is a component called `QuestionsView`, to show the list of questions, which is available [here](https://github.com/FissionHQ/vue-survey-builder/blob/master/src/QuestionsView.vue). Please use this component `QuestionsView` in case, you want to show the list of questions added.
4443

45-
You can import it like,
44+
You can import this component as shown below
4645

4746
`import { QuestionsView } from 'vue-survey-builder';`
4847

49-
and then use it like,
48+
Once you import it, you can use it in your component as shown below
5049

5150
`<QuestionsView :questions="questionsList" :readOnly="true" />`
5251

@@ -86,12 +85,8 @@ and then use it like,
8685
#### 0.1.0
8786
This version is the initial release of this open source project. It has all the required functionalities to build the surveys using vue.js
8887

89-
### To Do
90-
- Support for rating question
91-
- Introduce drag and drop
92-
9388
#### 0.2.0
94-
From this version you can import both `SurveyBuilder` and `QuestionsView` from `vue-survey-builder`.
89+
This version exports `SurveyBuilder`, `QuestionsView` and `SurveyBuilderJson` from index.js file.
9590

9691
### To Do
9792
- Support for rating question

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"vue",
1515
"vue-survey-builder",
1616
"survey-builder",
17-
"survey"
17+
"survey",
18+
"vue.js"
1819
],
1920
"author": "rajeshwar.patlolla@gmail.com",
2021
"license": "MIT",

0 commit comments

Comments
 (0)