1.代码测试优化

sws 2024-08-26
v1.0.0
sws 2024-08-26 15:15:35 +08:00
parent 89e6e8d192
commit 9ce49e0639
3 changed files with 28 additions and 27 deletions

View File

@ -1,7 +1,8 @@
<template> <template>
<div :style="style_container"> <div :style="style_container">
<div class="video re" :style="style"> <div class="video re" :style="style">
<video :poster="video_img" class="w h"></video> <image-empty v-if="!video_img" error-img-style="width:60px;height:60px;"></image-empty>
<video v-else :poster="video_img" class="w h"></video>
<img src="@/assets/images/components/model-video/video.png" class="middle box-shadow-sm round" width="60" height="60" /> <img src="@/assets/images/components/model-video/video.png" class="middle box-shadow-sm round" width="60" height="60" />
</div> </div>
</div> </div>
@ -23,7 +24,7 @@ watch(
(newVal, oldValue) => { (newVal, oldValue) => {
const new_content = newVal?.content || {}; const new_content = newVal?.content || {};
const new_style = newVal?.style || {}; const new_style = newVal?.style || {};
video_img.value = new_content?.video_img[0]?.url; video_img.value = new_content?.video_img[0]?.url || '';
// //
let video_ratio = ``; let video_ratio = ``;

View File

@ -1,9 +1,9 @@
import { get_math } from "@/utils"; import { get_math } from '@/utils';
import defaultCommon from "./index"; import defaultCommon from './index';
interface nav_group { interface nav_group {
id: string; id: string;
nav_image: uploadList[]; nav_image: uploadList[];
title: string, title: string;
title_link: object; title_link: object;
} }
interface defaultSearch { interface defaultSearch {
@ -45,28 +45,28 @@ const defaultSearch: defaultSearch = {
{ {
id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题 id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题
nav_image: [], nav_image: [],
title: '', title: '测试标题',
title_link: {}, title_link: {},
}, },
{ {
id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题 id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题
nav_image: [], nav_image: [],
title: '', title: '测试标题',
title_link: {}, title_link: {},
}, },
{ {
id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题 id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题
nav_image: [], nav_image: [],
title: '', title: '测试标题',
title_link: {}, title_link: {},
}, },
{ {
id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题 id: get_math(), // 唯一标识使用避免使用index作为唯一标识导致渲染节点出现问题
nav_image: [], nav_image: [],
title: '', title: '测试标题',
title_link: {}, title_link: {},
} },
] ],
}, },
style: { style: {
radius: 0, radius: 0,

View File

@ -1,5 +1,5 @@
import { get_math } from "@/utils"; import { get_math } from '@/utils';
import defaultCommon from "./index"; import defaultCommon from './index';
interface carousel_list { interface carousel_list {
id: string; id: string;
@ -25,11 +25,11 @@ interface defaultSearch {
news_typeface: string; news_typeface: string;
news_size: number; news_size: number;
topic_color_list: color_list[]; topic_color_list: color_list[];
topic_color: string, topic_color: string;
topic_typeface: string, topic_typeface: string;
topic_size: number, topic_size: number;
topic_width: number, topic_width: number;
topic_height: number topic_height: number;
common_style: object; common_style: object;
}; };
} }
@ -38,7 +38,7 @@ const defaultSearch: defaultSearch = {
notice_style: 'inherit', notice_style: 'inherit',
direction: 'vertical', direction: 'vertical',
title_type: 'img', title_type: 'img',
title: '', title: '测试标题',
img_src: [], img_src: [],
is_right_button: 'show', is_right_button: 'show',
interval_time: 2, interval_time: 2,
@ -46,11 +46,11 @@ const defaultSearch: defaultSearch = {
notice_list: [ notice_list: [
{ {
id: get_math(), id: get_math(),
notice_title: '', notice_title: '公告栏',
notice_link: {}, notice_link: {},
is_show: true is_show: true,
} },
] ],
}, },
style: { style: {
news_color: '#000', news_color: '#000',
@ -59,12 +59,12 @@ const defaultSearch: defaultSearch = {
topic_color_list: [ topic_color_list: [
{ {
color: '', color: '',
color_percentage: '' color_percentage: '',
}, },
{ {
color: '', color: '',
color_percentage: '' color_percentage: '',
} },
], ],
topic_color: '#000', topic_color: '#000',
topic_typeface: 'normal', topic_typeface: 'normal',
@ -72,7 +72,7 @@ const defaultSearch: defaultSearch = {
topic_width: 24, topic_width: 24,
topic_height: 24, topic_height: 24,
button_color: '#999', button_color: '#999',
common_style: defaultCommon common_style: defaultCommon,
}, },
}; };