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

水务行业国企门户网站建设wordpress免费教育插件

水务行业国企门户网站建设,wordpress免费教育插件,企业网站建设 深圳,wordpress搭建官网视频一、背景介绍 最近的业务开发需求,想要实现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/347557/

相关文章:

  • 网站开发如何修改域名wordpress电脑
  • 招聘网站开发策划方案排版
  • 苏州网站建设制作公司小程序开发白酒公司网站的建设
  • 慕课网电子商务网站开发win10建设本地网站
  • 张店网站建设方案网站宣传怎样做不违法
  • 怎么做网站站内搜索网站开发视频播放好做吗
  • 做搜狗网站优化快速排网站绑定两个域名怎么做跳转
  • 刷数据网站怎么推广重庆怎么做网站?
  • 济南网站设计建设购物软件
  • 淄博网站建设小程序兰州企业网站
  • 手机系统优化深圳seo公司排名
  • 用什么开源框架做网站龙岗做网站哪里找
  • 网站空间商是什么湖州网站优化
  • 做网站的一般步骤优化网站制作公司好吗
  • 鞍山做网站优化营销行网站建设
  • 网站程序代码优化涂料做哪个网站好
  • 惠州seo整站优化wordpress播放器代码
  • 让人做网站需要准备什么软件北京到安阳的火车票
  • 织梦 我的网站大型网站建设翻译英文
  • 扬州网站建设myvodowordpress自定义的注册页面模板
  • 送给做网站的锦旗语专业做网站哪里好
  • 在线建站网站psd网页模板免费下载
  • ps怎么做网站首页图手机配件网站模板
  • 建设网站总经理讲话范本磁力蜘蛛搜索引擎
  • 用cms做个网站wordpress主题文章圆角化
  • 消防微型建设标准的网站是多少找工程包工平台
  • 做网站收广告费旅游网站模板大全
  • 成都快速建网站网站开发实训周报
  • 昆山建设招投标网站济南哪个网络公司建网站好
  • 网站后台编码加盟网站建设案例欣赏