add step system

This commit is contained in:
Robin COuret
2026-02-24 14:37:33 +01:00
parent 375c6969cc
commit b97a18eab4
5 changed files with 69 additions and 29 deletions

View File

@@ -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>

View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
</script>
<template>
<div>
Loading...
</div>
</template>
<style scoped>
</style>

View File

@@ -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 }
})

View 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 }
})

View File

@@ -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/>