数通互联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

1 year ago
<template>
<!-- <p>{{ videoHeight }}</p>
<p>{{ videoWidth }}</p> -->
<video
:src="data?.control.videoMsg[0].url"
:loop="data?.control.videoMsg[0].loop"
:autoplay="data?.control.videoMsg[0].videoAutoPlay"
:style="getFormItemInputStyle(configStyle,2)"
1 year ago
controls
>
</video>
</template>
<script setup lang="ts">
import { AnalysisCss,AnalysisInputCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts'
1 year ago
const props = defineProps({
// eslint-disable-next-line vue/require-default-prop
data: {
type: Object,
}
})
const configStyle = computed(() => {
console.log("视频宽度",props.data)
return props.data.styles || {}
})
1 year ago
const videoHeight = props.data?.control.videoMsg[0].videoHeight+'px'
const videoWidth = props.data?.control.videoMsg[0].videoWidth+'px'
const heightVal = ref("0px")
const widthtVal = ref("0px")
onMounted(()=>{
heightVal.value = props.data?.control.videoMsg[0].videoHeight+'px'
widthtVal.value = props.data?.control.videoMsg[0].videoWidth+'px'
// console.log("视频得长款",heightVal.value, widthtVal.value,props.data?.control)
});
watch(()=>props.data?.control.videoMsg[0], (val:any) => {
// console.log("视频得长款--》",val);
heightVal.value = val.videoHeight+'px'
widthtVal.value = val.videoWidth+'px'
},{
deep: true,
})
const getFormItemInputStyle = (ele: any,sty:number) => {
if(ele?.inputStyle){
console.log("返回栅格宽度4",AnalysisInputCss(ele?.inputStyle,sty))
return AnalysisInputCss(ele?.inputStyle,sty)
}
}
1 year ago
</script>
<style scoped></style>