mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-27 06:31:45 +00:00
Use Vue setup directive (#2165)
This commit is contained in:
@@ -68,9 +68,9 @@
|
||||
</ListItem>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script lang="ts" setup>
|
||||
import { Tooltip } from 'floating-vue';
|
||||
import { defineComponent, PropType, toRef } from 'vue';
|
||||
import { toRef } from 'vue';
|
||||
|
||||
import Icon from '~/components/atomic/Icon.vue';
|
||||
import ListItem from '~/components/atomic/ListItem.vue';
|
||||
@@ -80,23 +80,10 @@ import PipelineStatusIcon from '~/components/repo/pipeline/PipelineStatusIcon.vu
|
||||
import usePipeline from '~/compositions/usePipeline';
|
||||
import { Pipeline } from '~/lib/api/types';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PipelineItem',
|
||||
const props = defineProps<{
|
||||
pipeline: Pipeline;
|
||||
}>();
|
||||
|
||||
components: { Icon, PipelineStatusIcon, ListItem, PipelineRunningIcon, Tooltip },
|
||||
|
||||
props: {
|
||||
pipeline: {
|
||||
type: Object as PropType<Pipeline>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
const pipeline = toRef(props, 'pipeline');
|
||||
const { since, duration, message, prettyRef, created } = usePipeline(pipeline);
|
||||
|
||||
return { since, duration, message, prettyRef, pipelineStatusColors, created };
|
||||
},
|
||||
});
|
||||
const pipeline = toRef(props, 'pipeline');
|
||||
const { since, duration, message, prettyRef, created } = usePipeline(pipeline);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user