add step system
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
<!-- @vue-ignore -->
|
||||
<b-input
|
||||
v-model="knowledgeModel"
|
||||
placeholder="Knowledge is an awareness of facts, a familiarity with individuals and situations, or a practical skill."
|
||||
maxlength="1200"
|
||||
type="textarea"
|
||||
required
|
||||
@@ -49,20 +50,32 @@
|
||||
<!-- @vue-ignore -->
|
||||
<b-input
|
||||
v-model="uriModel"
|
||||
placeholder="en.wikipedia.org/wiki/Knowledge"
|
||||
maxlength="100"
|
||||
required
|
||||
></b-input>
|
||||
</b-field>
|
||||
<b-button type="is-primary" @click="postKnowledge" >Submit</b-button>
|
||||
<div class="btn-container">
|
||||
<b-field>
|
||||
<div class="control">
|
||||
<b-button type="is-primary" @click="postKnowledge" >Share</b-button>
|
||||
</div>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.container{
|
||||
.container{
|
||||
background-color: #ffffff;
|
||||
border-radius: 16px;
|
||||
padding: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-container{
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
|
||||
</style>
|
||||
13
user-interface/src/components/LoadingModel.vue
Normal file
13
user-interface/src/components/LoadingModel.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
Loading...
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,12 +0,0 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return { count, doubleCount, increment }
|
||||
})
|
||||
24
user-interface/src/stores/steps.ts
Normal file
24
user-interface/src/stores/steps.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ref, computed, type Component } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import CollectKnowledge from '@/components/CollectKnowledge.vue'
|
||||
import LoadingModel from '@/components/LoadingModel.vue'
|
||||
import EvaluateQuestion from '@/components/EvaluateQuestion.vue'
|
||||
|
||||
const steps: Component = [
|
||||
CollectKnowledge,
|
||||
LoadingModel,
|
||||
EvaluateQuestion
|
||||
]
|
||||
|
||||
export const useStepsStore = defineStore('steps', () => {
|
||||
const indexStep = ref(0)
|
||||
|
||||
const getCurrentComponent = computed(() => steps[indexStep.value])
|
||||
|
||||
function nextStep() {
|
||||
indexStep.value++
|
||||
}
|
||||
|
||||
return { steps, getCurrentComponent, nextStep }
|
||||
})
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import ReadKnowledges from '@/components/ReadKnowledges.vue';
|
||||
import CollectKnowledge from '@/components/CollectKnowledge.vue';
|
||||
//import EvaluateQuestion from '@/components/EvaluateQuestion.vue';
|
||||
import ReadKnowledges from '@/components/ReadKnowledges.vue';
|
||||
import { useStepsStore } from '@/stores/steps'
|
||||
|
||||
const stepsStore = useStepsStore()
|
||||
stepsStore
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -10,7 +12,7 @@ import CollectKnowledge from '@/components/CollectKnowledge.vue';
|
||||
<ReadKnowledges/>
|
||||
</section>
|
||||
<section id="section-central">
|
||||
<CollectKnowledge/>
|
||||
<component :is="stepsStore.getCurrentComponent"></component>
|
||||
</section>
|
||||
<!-- <section>
|
||||
<EvaluateQuestion/>
|
||||
|
||||
Reference in New Issue
Block a user