Sha256: dcff6b16081a033c4cb206e4bcf605854784676531bcf471b727650c3552a00d
Contents?: true
Size: 1.24 KB
Versions: 14
Compression:
Stored size: 1.24 KB
Contents
<template> <Loading v-if="getArtifactTask.isRunning"></Loading> <ErrorMessage v-if="getArtifactTask.isError" :error="getArtifactTask.last?.error"></ErrorMessage> <ArtifactComponent :artifact="getArtifactTask.last.value" @refresh="refresh" v-if="getArtifactTask.last?.value" ></ArtifactComponent> </template> <script lang="ts"> import { defineComponent, onMounted, watch } from "vue" import { generateGetArtifactTask } from "@/api-helper" import ArtifactComponent from "@/components/artifact/Artifact.vue" import ErrorMessage from "@/components/ErrorMessage.vue" import Loading from "@/components/Loading.vue" export default defineComponent({ name: "ArtifactWrapper", components: { ArtifactComponent, Loading, ErrorMessage }, props: { id: { type: String, required: true } }, setup(props) { const getArtifactTask = generateGetArtifactTask() const getArtifact = async () => { await getArtifactTask.perform(props.id) } const refresh = async () => { await getArtifact() } onMounted(async () => { await getArtifact() }) watch(props, async () => { await getArtifact() }) return { getArtifactTask, refresh } } }) </script>
Version data entries
14 entries across 14 versions & 1 rubygems