✨ (task) display step examples only for the first time
This commit is contained in:
@@ -13,6 +13,7 @@ const store = useTaskStore()
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const props = defineProps<{ id: string; initialTask?: Taskable }>()
|
const props = defineProps<{ id: string; initialTask?: Taskable }>()
|
||||||
const id = computed(() => props.id)
|
const id = computed(() => props.id)
|
||||||
|
const hasTasks = computed(() => store.tasks.length > 0)
|
||||||
|
|
||||||
const exampleSteps: Stepable[] = [
|
const exampleSteps: Stepable[] = [
|
||||||
{
|
{
|
||||||
@@ -47,7 +48,9 @@ const exampleSteps: Stepable[] = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
const steps = ref<Stepable[]>(props.initialTask?.steps ?? exampleSteps)
|
const steps = ref<Stepable[]>(
|
||||||
|
props.initialTask?.steps ?? hasTasks.value ? [] : exampleSteps
|
||||||
|
)
|
||||||
|
|
||||||
const title = ref(props.initialTask?.title ?? '')
|
const title = ref(props.initialTask?.title ?? '')
|
||||||
const link = ref(props.initialTask?.link ?? '')
|
const link = ref(props.initialTask?.link ?? '')
|
||||||
|
|||||||
Reference in New Issue
Block a user