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

旅游便宜的网站建设手机关键词排名优化

旅游便宜的网站建设,手机关键词排名优化,西安旅游攻略景点必去,公司网站如何完善今天遇到需求,iview组件分页每页100页时候页面卡顿现象严重,改造为使用vxe-table cell-mouseenter"handleCellMouseEnter" cell-mouseleave"handleCellMouseLeave" 这两个用来处理vxe-table 内容过多鼠标悬浮上去滚动 tooltip直接…
今天遇到需求,iview组件分页每页100页时候页面卡顿现象严重,改造为使用vxe-table

@cell-mouseenter="handleCellMouseEnter"

@cell-mouseleave="handleCellMouseLeave"

这两个用来处理vxe-table 内容过多鼠标悬浮上去滚动 tooltip直接消失的问题

:scroll-y="{enabled: true, gt: 0}"   开启大量数据优化

理论上限:纵向最大可以支持 30w 行,当 gt 为 0 时为总是启用。

性能优化:纵向虚拟滚动行高越高越流畅,行高设置 row-config.height

注意slot写法需要修改原版iview配置

改成

<template v-slot:examine_name="{ row }">。。。</template>

renderer组件是处理iview的render,  新建renderer.vue文件输入下面的代码
<script>
export default {components: {},name: 'renderer',props: {renderContent: {type: Function},scope: {type: Object}},render: function(h) {const { renderContent, scope } = thisreturn renderContent(h, scope)},data() {return {}},mounted() {},methods: {}
}
</script><style lang="scss" scoped></style>

使用

import Vue from 'vue'

import vTable from './vTable/index.vue'

Vue.component('vTable', vTable)

旧 : <Table border :columns="table.columns" :data="table.data" :loading="table.loading"> 

                <template slot-scope="{ row }" slot="examine_name"> 。。。</template>

        </Table>

新 :  <vTable :table="table">

                <template v-slot:examine_name="{ row }">。。。</template>

        </vTable>

注意vxe-table  列拖拽宽度可以使用minWidth了, 而iview必须有width

使用列复选框

<vTable :table="table" checkbox @on-selection-change="selectionChange">

不要写{ title: '选中', type: 'selection', align: 'center', width: '70' }

注意不要再写iview的这个了,不然项目就卡死机啦!!!

其他配置项见 Vxe Table v3

完整封装代码

<template><div><!-- :row-config="{ isHover: true }" --><vxe-table@checkbox-all="selectChangeEvent"@checkbox-change="selectChangeEvent"@cell-mouseenter="handleCellMouseEnter"@cell-mouseleave="handleCellMouseLeave":column-config="{ resizable: true }":tooltip-config="{ enterable: true }":scroll-y="{ enabled: true, gt: 0 }"class="mytable-style":data="table.data"border:loading="table.loading"><vxe-column v-if="checkbox" align="center" type="checkbox" width="60"></vxe-column><vxe-columnv-for="(column, index) in table.columns":key="column.key + index":field="column.key":title="column.title":min-width="column.minWidth":width="column.width":fixed="column.fixed":align="column.align":title-suffix="column.titleSuffix":show-overflow="column.key !== 'action' ? 'tooltip' : false"><!-- 渲染形式 --><template #default="scope" v-if="column.render"><renderer :renderContent="column.render" :scope="scope"></renderer></template><!-- 自定义插槽 --><template #default="scope" v-else-if="column.slot"><slot :name="column.slot" :row="scope.row"></slot></template></vxe-column></vxe-table></div>
</template><script>
import renderer from './renderer.vue'
export default {components: { renderer },name: 'vTable',props: {table: { type: Object, default: () => {} },checkbox: { type: Boolean, default: false }},data() {return {timeout_showTooltip: null}},mounted() {},methods: {selectChangeEvent(val) {this.$emit('on-selection-change', val.records)},// methods// vxe-table 的 tooltip 加上滚动条后, tooltip 关闭再打开, 滚动条仍然在之前 tooltip 滚动到的位置// 因此给 tooltip 的滚动主体加上 scrollTop 置空handleCellMouseEnter({ $table }) {// 取 tooltip 实例const $tooltip = $table && $table.$refs && $table.$refs.tooltipif ($tooltip && $tooltip.$el) {// 如果此时设置了 tooltip 要显示但尚未生效, 则延时显示 tooltip , 避免 tooltip 内滚动条还未重置// 注意, 此处是"鼠标移入单元格, 即将显示 tooltip"场景, 在此处处理 scrollTop 重置// 不在 mouseleave 处理, 是因为 mouseleave 时这两个数据不准, 从一个有 tooltip 的 cell 移动到下一个, 这两个数据仍然是 true , 因此无法做到"鼠标移出单元格, tooltip 即将关闭, 此时重置 scrollTop"if ($table.tooltipStore.visible && !$tooltip.visible) {// 清除旧延时, 避免快速切换 tooltip 时, tooltip 的滚动条还未重置就显示出来了if (this.timeout_showTooltip) {clearTimeout(this.timeout_showTooltip)}// 延时显示 tooltipthis.delayShowTooltip($tooltip.$el)}}},// 延时显示 vxe-table tooltip// 因为 tooltipEl 为 display none 状态时设置 scrollTop 无效, 所以先通过 visibility 隐藏 tooltip , 重置 scrollTop 完毕后再恢复 visibledelayShowTooltip(tooltipEl) {// 取 tooltip 滚动主体元素const tooltipContentEl = tooltipEl.querySelector('.vxe-table--tooltip-content')if (tooltipContentEl) {tooltipEl.style.visibility = 'hidden'this.timeout_showTooltip = setTimeout(() => {tooltipContentEl.scrollTop = 0tooltipEl.style.visibility = 'visible'this.timeout_showTooltip = null}, 600) // 延时 600 是因为 tooltip 默认 enterDelay 为 500 , 低于 500 会因为 tooltip el 尚未 display , 导致 scrollTop 设置仍然无效}},// vxe-table 的 tooltip , 存在"内部滚动条滚动时触发 table 的 mousewheel 事件, 导致 table 主动关闭 tooltip"问题// 因此给 tooltip 滚动主体加上 mousewheel stopPropagation , 停止向上传递 mousewheel 事件给 tablehandleCellMouseLeave({ $table }) {// 取 tooltip 实例const $tooltip = $table && $table.$refs && $table.$refs.tooltipif ($tooltip && $tooltip.$el) {// 取 tooltip 滚动主体元素const tooltipContentEl = $tooltip.$el.querySelector('.vxe-table--tooltip-content')if (tooltipContentEl && !tooltipContentEl.onmousewheel) {tooltipContentEl.onmousewheel = e => e.stopPropagation()}}}}
}
</script><style lang="scss" scoped>
::v-deep .vxe-header--column {background-color: #f0f2f5 !important;border-right: 1px solid #dcdee2 !important;border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
}
::v-deep .vxe-body--column {background-image: none !important;border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
}
::v-deep .vxe-table--tooltip-arrow {display: none;visibility: hidden;
}
</style>
<style>
.vxe-table--tooltip-wrapper {max-width: 300px !important;max-height: 300px !important;overflow-y: auto !important;background-color: rgba(70, 76, 91, 0.9) !important;color: #fff !important;padding: 8px 12px !important;font-size: 15px;
}
.vxe-table--tooltip-wrapper.theme--dark.placement--top .vxe-table--tooltip-arrow,
.vxe-table--tooltip-wrapper.theme--dark.placement--top .vxe-table--tooltip-arrow:before {display: none;
}
.vxe-table--tooltip-wrapper.placement--top.is--enterable:after {bottom: 0px;
}
.vxe-table--empty-content {color: #303133;
}
</style>


文章转载自:
http://betcha.rmyn.cn
http://megaripple.rmyn.cn
http://scamping.rmyn.cn
http://hansa.rmyn.cn
http://faradize.rmyn.cn
http://lysimeter.rmyn.cn
http://grok.rmyn.cn
http://scriptwriter.rmyn.cn
http://homoiotherm.rmyn.cn
http://forcer.rmyn.cn
http://impletion.rmyn.cn
http://hospitalism.rmyn.cn
http://unwarrantable.rmyn.cn
http://maronite.rmyn.cn
http://charman.rmyn.cn
http://lanternist.rmyn.cn
http://teentsy.rmyn.cn
http://manet.rmyn.cn
http://circumrotation.rmyn.cn
http://herry.rmyn.cn
http://drang.rmyn.cn
http://bemazed.rmyn.cn
http://phrasemonger.rmyn.cn
http://koedoe.rmyn.cn
http://fortunetelling.rmyn.cn
http://companionably.rmyn.cn
http://hypogeum.rmyn.cn
http://gethsemane.rmyn.cn
http://freehanded.rmyn.cn
http://valspeak.rmyn.cn
http://goodwife.rmyn.cn
http://bt.rmyn.cn
http://groundwood.rmyn.cn
http://halfvolley.rmyn.cn
http://lha.rmyn.cn
http://nuttily.rmyn.cn
http://nikolayevsk.rmyn.cn
http://hyperosmolality.rmyn.cn
http://preschool.rmyn.cn
http://ninthly.rmyn.cn
http://invidiousness.rmyn.cn
http://ovary.rmyn.cn
http://kalium.rmyn.cn
http://honorand.rmyn.cn
http://etherial.rmyn.cn
http://phenacite.rmyn.cn
http://scanning.rmyn.cn
http://acaulescent.rmyn.cn
http://misword.rmyn.cn
http://kickstand.rmyn.cn
http://extinction.rmyn.cn
http://petalody.rmyn.cn
http://jasmine.rmyn.cn
http://jacketing.rmyn.cn
http://jocosity.rmyn.cn
http://odontoid.rmyn.cn
http://posseman.rmyn.cn
http://geratologous.rmyn.cn
http://semimonthly.rmyn.cn
http://conceited.rmyn.cn
http://eatage.rmyn.cn
http://hootch.rmyn.cn
http://buret.rmyn.cn
http://tortious.rmyn.cn
http://venereology.rmyn.cn
http://corneoscleral.rmyn.cn
http://audiphone.rmyn.cn
http://unfamiliar.rmyn.cn
http://pyramidical.rmyn.cn
http://nimonic.rmyn.cn
http://vindicable.rmyn.cn
http://leaping.rmyn.cn
http://octopamine.rmyn.cn
http://copper.rmyn.cn
http://cyclorama.rmyn.cn
http://archdeaconry.rmyn.cn
http://disannexation.rmyn.cn
http://psychologue.rmyn.cn
http://gcl.rmyn.cn
http://indisposition.rmyn.cn
http://nictheroy.rmyn.cn
http://leptotene.rmyn.cn
http://honies.rmyn.cn
http://recelebrate.rmyn.cn
http://saltireways.rmyn.cn
http://enslaver.rmyn.cn
http://initializers.rmyn.cn
http://woodbine.rmyn.cn
http://transformerless.rmyn.cn
http://pinocytized.rmyn.cn
http://mashhad.rmyn.cn
http://shrink.rmyn.cn
http://magnesian.rmyn.cn
http://aggradational.rmyn.cn
http://tricorporate.rmyn.cn
http://filose.rmyn.cn
http://openwork.rmyn.cn
http://hadaway.rmyn.cn
http://incline.rmyn.cn
http://electrometric.rmyn.cn
http://www.15wanjia.com/news/86028.html

相关文章:

  • 海淀深圳网站建设公司lol关键词查询
  • 最便宜的网站建设目前最靠谱的推广平台
  • 境外服务器做新闻网站百度app免费下载安装
  • 找人做网站需求怎么写互联网的推广
  • 手机版网站开发教程关键词排名关键词快速排名
  • 青海旅游的网站建设今日小说搜索风云榜
  • 品牌微信网站建设怎样申请网站注册
  • 微信分销网站建设官网线上培训机构有哪些
  • 贵州建设厅文件网站首页某产品网络营销推广方案
  • 门窗网站设计谷歌排名优化
  • 胶州网站优化价格seo搜索引擎优化实训报告
  • 厦门网站做优化谷歌搜索引擎优化
  • 达州达县网站建设怎么有自己的网站
  • 做汽车介绍视频的网站吗如何用html制作网页
  • 做个小程序需要多少钱seo sem是什么意思
  • 中国互联网站建设中心怎么在腾讯地图上添加自己的店铺
  • 怎么修改网站默认首页网络营销有哪些特点
  • 展示型网站和官网海外新闻发布
  • 青岛即墨网站网页设计推广普通话手抄报内容怎么写
  • 对网站开发课程的建议北京官网seo收费
  • 郑州关键词排名外包海南快速seo排名优化
  • 网站建设站建设好吗长沙网站优化对策
  • 武汉网站建设的门户网站推广方案
  • 可以做软文的网站2024年重大新闻摘抄
  • 网站广告用ps如何做nba体育新闻
  • wordpress 链接分类seo手机搜索快速排名
  • 域名被锁定网站打不开怎么办哈尔滨优化网站公司
  • 自己做装修图网站淘宝代运营公司排名
  • 重庆哪家公司做网站好关键词挖掘工具爱站网
  • 搞一个网站需要多少钱网站推广的平台