35 lines
648 B
Vue
35 lines
648 B
Vue
<template>
|
|
<el-button
|
|
v-if="videoCount > 0"
|
|
link
|
|
type="primary"
|
|
size="small"
|
|
@click.stop="$emit('click')"
|
|
>
|
|
<el-icon style="margin-right:2px"><VideoCameraFilled /></el-icon>
|
|
有视频 ({{ videoCount }})
|
|
</el-button>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { VideoCameraFilled } from '@element-plus/icons-vue'
|
|
|
|
export interface VideoItem {
|
|
id: number
|
|
video_url: string
|
|
camera_id?: number
|
|
camera_name?: string
|
|
}
|
|
|
|
const props = defineProps<{
|
|
videos: VideoItem[]
|
|
}>()
|
|
|
|
defineEmits<{
|
|
click: []
|
|
}>()
|
|
|
|
const videoCount = computed(() => props.videos?.length ?? 0)
|
|
</script>
|