Vue项目引用dataV组件,部署后出现样式错乱Component width or height is 0px,rendering abnormality may occur

本文主要是介绍Vue项目引用dataV组件,部署后出现样式错乱Component width or height is 0px,rendering abnormality may occur,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

vue项目引用组件dataV,在本地运行时没有问题,打包放到服务器上后,刷新页面会出现样式错乱问题
控制台报警告
在这里插入图片

这时候我手动缩放一下页面又会变正常
我猜测是刷新了页面,组件适配时还没有获取到dom

在更改多方无果后,我去dataV官网看到了这个
在这里插入图片描述
因为我是只有在刷新后才会出现样式错乱问题,所以只监听了刷新操作,核心代码如下:

<template><div class="wraps"><div class="title">123123</div><div class="page_banner"><dv-scroll-boardclass="banner":config="config"style="width: 99%; height: 95%; font-size: 16px !important":key="key"/></div></div>
</template><script>
import { findActivities } from '@/api/index'export default {data() {return {key:11,//在dataV上绑定key值ww: [],config: {header: ['name1', 'name2'],data: [],rowNum: 4,headerBGC: '#1e5791',headerHeight: 40,waitTime: '5000',carousel: 'page',align: ['center', 'center'],oddRowBGC: '#0a1651',evenRowBGC: ''},times: null}},mounted() {this.pieOutlineFunc()this.getData()this.times = setInterval(() => {this.getData()}, 1000 * 360)},destroyed() {//销毁clearInterval(this.times)},methods: {async getData() {const res = await findActivities().then(res=>{return res.data.data})const Data = res.map((item) => {return [item.name, item.date.split(' ')[0]]})this.$nextTick(() => {this.config.data = Datathis.config = { ...this.config }})},pieOutlineFunc() {var _this = thiswindow.addEventListener('pageshow', function (e) {_this.$nextTick(() => {_this.key++})})}}
}
</script>
<style lang="less" scoped>
.wraps {width: 100%;height: 100%;
}
.title {width: 100%;height: 11%;font-size: 18px;color: white;display: flex;justify-content: center;align-items: center;background: url('@/assets/image/borderTitle.png');background-repeat: no-repeat;background-size: 100.5% 100%;
}
.page_banner {width: 99.5%;height: 84%;margin: 0 auto;padding-top: 3%;
}
.banner {margin: 0 auto;font-size: 16px;/deep/.header {font-size: 16px !important;}/deep/.rows .row-item {font-size: 15px !important;}
}
</style>

这篇关于Vue项目引用dataV组件,部署后出现样式错乱Component width or height is 0px,rendering abnormality may occur的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/832646

相关文章

UnrealScriptIDE调试环境部署

先安装vs2010   再安装VSIsoShell.exe, 下载地址 https://pan.baidu.com/s/10kPNUuDGTbWXbz7Nos-1WA       fd3t   最后安装unside,下载地址 https://archive.codeplex.com/?p=uside  安装中间有一步选择Binary文件夹要选对路径。   安装好以后,启动 UDKDe

用Microsoft.Extensions.Hosting 管理WPF项目.

首先引入必要的包: <ItemGroup><PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /><PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /><PackageReference Include="Serilog

eclipse运行springboot项目,找不到主类

解决办法尝试了很多种,下载sts压缩包行不通。最后解决办法如图: help--->Eclipse Marketplace--->Popular--->找到Spring Tools 3---->Installed。

公共筛选组件(二次封装antd)支持代码提示

如果项目是基于antd组件库为基础搭建,可使用此公共筛选组件 使用到的库 npm i antdnpm i lodash-esnpm i @types/lodash-es -D /components/CommonSearch index.tsx import React from 'react';import { Button, Card, Form } from 'antd'

vue, 左右布局宽,可拖动改变

1:建立一个draggableMixin.js  混入的方式使用 2:代码如下draggableMixin.js  export default {data() {return {leftWidth: 330,isDragging: false,startX: 0,startWidth: 0,};},methods: {startDragging(e) {this.isDragging = tr

vue项目集成CanvasEditor实现Word在线编辑器

CanvasEditor实现Word在线编辑器 官网文档:https://hufe.club/canvas-editor-docs/guide/schema.html 源码地址:https://github.com/Hufe921/canvas-editor 前提声明: 由于CanvasEditor目前不支持vue、react 等框架开箱即用版,所以需要我们去Git下载源码,拿到其中两个主

React+TS前台项目实战(十七)-- 全局常用组件Dropdown封装

文章目录 前言Dropdown组件1. 功能分析2. 代码+详细注释3. 使用方式4. 效果展示 总结 前言 今天这篇主要讲全局Dropdown组件封装,可根据UI设计师要求自定义修改。 Dropdown组件 1. 功能分析 (1)通过position属性,可以控制下拉选项的位置 (2)通过传入width属性, 可以自定义下拉选项的宽度 (3)通过传入classN

js+css二级导航

效果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Con

基于Springboot + vue 的抗疫物质管理系统的设计与实现

目录 📚 前言 📑摘要 📑系统流程 📚 系统架构设计 📚 数据库设计 📚 系统功能的具体实现    💬 系统登录注册 系统登录 登录界面   用户添加  💬 抗疫列表展示模块     区域信息管理 添加物资详情 抗疫物资列表展示 抗疫物资申请 抗疫物资审核 ✒️ 源码实现 💖 源码获取 😁 联系方式 📚 前言 📑博客主页:

vue+el国际化-东抄西鉴组合拳

vue-i18n 国际化参考 https://blog.csdn.net/zuorishu/article/details/81708585 说得比较详细。 另外做点补充,比如这里cn下的可以以项目模块加公共模块来细分。 import zhLocale from 'element-ui/lib/locale/lang/zh-CN' //引入element语言包const cn = {mess