当前位置: 首页 > news >正文

做电子元器件的网站网站建设与管理答案

做电子元器件的网站,网站建设与管理答案,网站建设方案.doc,ps做的网站一、背景介绍 最近的业务开发需求,想要实现echarts图表大屏滚动,小编首先采用vue-seamless-scroll进行实现,结果发现第二屏出现空白间隔,尝试了多种解决方案均不生效,最终选择换一个方案。 二、封装的ScrollList组件…

一、背景介绍

最近的业务开发需求,想要实现echarts图表大屏滚动,小编首先采用vue-seamless-scroll进行实现,结果发现第二屏出现空白间隔,尝试了多种解决方案均不生效,最终选择换一个方案。

二、封装的ScrollList组件

<template><div class="scrollContainer" :id="id" @mouseenter="monseenter" @mouseleave="mouseleave"><slot></slot></div>
</template><script>
export default {name: 'ScrollList',props: {id: String},data() {return {timer: null};},methods: {init() {this.setTimer();// this.$once代表只执行一次。如果组件是在keep-alive中包裹,则需要更换函数// 被keep-alive包裹住的组件有两个生命周期函数:activated和deactivatedthis.$once('hook:beforeDestroy', () => {this.removeTimer();});},removeTimer() {if (this.timer) {clearInterval(this.timer);this.timer = null;}},setTimer() {this.removeTimer();this.timer = setInterval(() => {// pixel height:include el and padding    read onlyconst scrollHeight = document.getElementById(this.id).scrollHeight;// visible area height:include el and padding  read onlyconst clientHeight = document.getElementById(this.id).clientHeight;const heightDifference = scrollHeight - clientHeight;// scroll height:readable and writabledocument.getElementById(this.id).scrollTop++;// when el scroll to topif (document.getElementById(this.id).scrollTop >= heightDifference - 1) {this.removeTimer();// make it go back to original location after one secondsetTimeout(() => {document.getElementById(this.id).scrollTop = 0;this.setTimer();}, 1000);}}, 44);},monseenter() {this.removeTimer();},mouseleave() {this.setTimer();}},mounted() {this.init();}
};
</script><style lang="scss" scoped>
.scrollContainer::-webkit-scrollbar {display: none;
}
.scrollContainer::scrollbar {display: none;
}
.scrollContainer {height: 100%;overflow: scroll;overflow-x: hidden;
}
</style>

三、使用ScrollList组件

<template><div><scrollList :id="'leftList'"><!-- todo 写需要循环滚动的代码 --></scrollList></div>
</template><script>import scrollList from '@/components/scrollList/index'export default {components: {scrollList}}
</script>
http://www.yayakq.cn/news/654349/

相关文章:

  • 建站平台系统如何制作小程序下单
  • 淘客网站开发百家号seo怎么做
  • 新能源网站建设哪家好做众筹网站怎么赚钱
  • vs做网站视频教程seoul什么意思
  • 网站开发需要的工具腾讯企业邮箱个人登录入口
  • 曰本做爰l网站互联网推广培训机构
  • 网站图片设置链接北京建设工程造价信息
  • 大麦网网站建设的功能定位济南建设网站需要
  • 原创文章网站更新wordpress默认主题的坏处
  • 个人站长做哪些网站好网站做301
  • 做宝玉石交易的网站有哪些廊坊自助建站模板
  • 家政服务网站建设wordpress上传主题没图片
  • php网站打开一片空白有哪些app软件开发公司
  • 2018网站建设空滤网站怎么做
  • 任意的关键词或网站做引流建设一个网站项目预算
  • 网站开发培训网中国优秀网站建设官网
  • 如何做新网站保留域名做视频网站被判刑
  • 企业推广建站wordpress 文章主题
  • 陕西网站建设价位多少福田庆三双眼皮修复案例
  • wap网站服务器微信上怎么做广告推广
  • 免费网站收录提交微山本地有做网站的么
  • 怎么创造一个网站电子商城网站
  • 常州网站排名推广kali钓鱼网站制作
  • 响应式网站 手机站做ppt的图片素材网站有哪些
  • 本地推广找哪些网站企业为什么需要会计
  • 专业的营销网站记录开发wordpress主题
  • 网站开发与编程兰州彩票网站制作
  • 山东建设厅造价员网站手机网站app开发
  • 网上书城网站开发的目的与意义一人可做的加盟店
  • 南充网站建设多少钱uzi粉丝做的网站