瀏覽代碼

:wrench: rendering Aspects component

tags/0.0.3^2
juancarbajal98 3 年之前
父節點
當前提交
c383dee01d
共有 2 個檔案被更改,包括 15 行新增0 行删除
  1. 1
    0
      frontend/src/utils/survey.js
  2. 14
    0
      frontend/src/views/OnboardingView.vue

+ 1
- 0
frontend/src/utils/survey.js 查看文件

@@ -16,6 +16,7 @@ const promptToComponent = {
16 16
     distance: 'FormInput',
17 17
     zipcode: 'FormInput',
18 18
     blurb: 'FormInput',
19
+    aspects: 'Aspects'
19 20
 }
20 21
 /**
21 22
  * Make a step from match or step information

+ 14
- 0
frontend/src/views/OnboardingView.vue 查看文件

@@ -46,8 +46,22 @@ export default {
46 46
     }),
47 47
     async created() {
48 48
         this.survey = await surveyFactory.createSurvey(allSteps['usa'])
49
+        this.configureAspectStep()
49 50
     },
50 51
     methods: {
52
+        configureAspectStep(){
53
+            // remove all steps regarding aspects
54
+            this.survey.steps = this.survey.steps.slice(0,this.survey.steps.length-6)
55
+            // insert single step to render Aspects component
56
+            this.survey.steps.push({
57
+                response_key_id:1,
58
+                response_key_category:"profile",
59
+                response_key_prompt:"aspects",
60
+                response_key_description:"",
61
+                responses:[],
62
+                component:"Aspects"
63
+            })
64
+        },
51 65
         onSubmit() {
52 66
             console.log(JSON.stringify(this.answered))
53 67
         },

Loading…
取消
儲存