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

建设银行网银网站特色邮箱域名

建设银行网银网站特色,邮箱域名,如何上wordpress,帮境外赌场做网站是否有风险组件数据懒加载-基本使用 目标#xff1a;通过useIntersectionObserver优化新鲜好物和人气推荐模块 电商类网站#xff0c;尤其是首页#xff0c;内容有好几屏#xff0c;而如果一上来就加载所有屏的数据#xff0c;并渲染所有屏的内容会导致首页加载很慢。 数据懒加载通过useIntersectionObserver优化新鲜好物和人气推荐模块 电商类网站尤其是首页内容有好几屏而如果一上来就加载所有屏的数据并渲染所有屏的内容会导致首页加载很慢。 数据懒加载等组件正式进入到可视区中时才把组件内部的ajax请求发起否则不请求数据 1优化新鲜好物 script langts setup const { home } useStore() const target ref(null) const { stop } useIntersectionObserver(target, ([{ isIntersecting }]) {console.log(isIntersecting)// isIntersecting 是否进入可视区域true是进入 false是移出if (isIntersecting) {home.getNewList()stop()} }) /scripttemplatediv classhome-newHomePanel reftarget title新鲜好物 sub-title新鲜出炉 品质靠谱/HomePanel/div /template2优化人气推荐 script langts setup const { home } useStore() const target ref(null) const { stop } useIntersectionObserver(target, ([{ isIntersecting }]) {console.log(isIntersecting)// isIntersecting 是否进入可视区域true是进入 false是移出if (isIntersecting) {home.getHotList()stop()} }) /script templateHomePanel reftarget title人气推荐 sub-title人气爆款 不容错过/HomePanel /template给ref添加组件类型 参考链接:https://staging-cn.vuejs.org/guide/typescript/composition-api.html#typing-component-template-refs !-- App.vue -- script setup langts import MyModal from ./MyModal.vueconst modal refInstanceTypetypeof MyModal | null(null)const openModal () {modal.value?.open() } /script组件数据懒加载-封装 目标封装组件数据懒加载可复用的逻辑 分析 首页中很多地方都应该使用组件数据懒加载这个功能不管是哪个模块使用下面代码都会重复书写 事实上唯一可能会随着业务使用发生变化的是 ajax接口的调用 其余的部分我们进行重复使用抽离为可复用逻辑 核心代码 1封装通用的懒加载数据api src/utils/hooks.ts // 自定义一些通用的compositions api import { useIntersectionObserver } from vueuse/core import { ref } from vue// 封装通用的数据懒加载api export function useLazyData(apiFn: () void) {// 通过 ref 获得组件实例const target ref(null)const { stop } useIntersectionObserver(// target 是观察的目标dom容器必须是dom容器而且是vue3.0方式绑定的dom对象target,// isIntersecting 是否进入可视区域true是进入 false是移出// observerElement 被观察的dom([{ isIntersecting }]) {// 在此处可根据isIntersecting来判断然后做业务if (isIntersecting) {stop()apiFn()}})return target }2优化新鲜好物 script langts setup const target useLazyData(() {home.getNewList() }) /script templatediv classhome-newHomePanel reftarget title新鲜好物 sub-title新鲜出炉 品质靠谱/HomePanel/div /template3优化人气推荐 script langts setup const target useLazyData(() {home.getHotList() }) /script templateHomePanel reftarget title人气推荐 sub-title人气爆款 不容错过/HomePanel /template拓展小知识自定义lazyhook的类型优化 export function useLazyApi(apiFn: () void) {const target refMaybeElementRef | null(null)const {stop} useIntersectionObserver(target, ([{isIntersecting}]) {if (isIntersecting) {stop()apiFn()}})return target }添加了ref类型提示MaybeElementRef - 暴露出去的taget如果赋值类型不对会进行提示 看一下MaybeElementRef到底是什么类型 declare type MaybeElementRefT extends MaybeElement MaybeElement MaybeRefT; declare type MaybeElement HTMLElement | SVGElement | VueInstance | undefined | null; declare type MaybeRefT T | RefT;总结MaybeElementRef类型的类型为 MaybeElement的Ref类型或者直接为MayBeElement类型 首页主体-滚动加载商品的bug 产品区域需要滚动比较多才能去加载数据。threshold 容器和可视区交叉的占比进入的面积/容器完整面积 取值0-1 之间默认比0大所以需要滚动较多才能触发进入可视区域事件。 阈值 (进入的面积/容器完整面积) const { stop } useIntersectionObserver(target,([{ isIntersecting }], observerElement) {if (isIntersecting) {stop()// 调用API获取数据apiFn().then(data {result.value data.result})}},{threshold: 0} ) rElement) {if (isIntersecting) {stop()// 调用API获取数据apiFn().then(data {result.value data.result})}},{threshold: 0} )
文章转载自:
http://www.morning.lqzhj.cn.gov.cn.lqzhj.cn
http://www.morning.qrcxh.cn.gov.cn.qrcxh.cn
http://www.morning.pnljy.cn.gov.cn.pnljy.cn
http://www.morning.xfmzk.cn.gov.cn.xfmzk.cn
http://www.morning.kwz6232.cn.gov.cn.kwz6232.cn
http://www.morning.rqgq.cn.gov.cn.rqgq.cn
http://www.morning.mslsn.cn.gov.cn.mslsn.cn
http://www.morning.hwtb.cn.gov.cn.hwtb.cn
http://www.morning.dqdss.cn.gov.cn.dqdss.cn
http://www.morning.gqcd.cn.gov.cn.gqcd.cn
http://www.morning.yqsq.cn.gov.cn.yqsq.cn
http://www.morning.jgttx.cn.gov.cn.jgttx.cn
http://www.morning.mpnff.cn.gov.cn.mpnff.cn
http://www.morning.zlxrg.cn.gov.cn.zlxrg.cn
http://www.morning.bkkgt.cn.gov.cn.bkkgt.cn
http://www.morning.lxhgj.cn.gov.cn.lxhgj.cn
http://www.morning.ylpl.cn.gov.cn.ylpl.cn
http://www.morning.bprsd.cn.gov.cn.bprsd.cn
http://www.morning.zwznz.cn.gov.cn.zwznz.cn
http://www.morning.jcfdk.cn.gov.cn.jcfdk.cn
http://www.morning.qrqcr.cn.gov.cn.qrqcr.cn
http://www.morning.qnbgh.cn.gov.cn.qnbgh.cn
http://www.morning.pjqxk.cn.gov.cn.pjqxk.cn
http://www.morning.nwzcf.cn.gov.cn.nwzcf.cn
http://www.morning.crrmg.cn.gov.cn.crrmg.cn
http://www.morning.mmzfl.cn.gov.cn.mmzfl.cn
http://www.morning.qfwfj.cn.gov.cn.qfwfj.cn
http://www.morning.xfrqf.cn.gov.cn.xfrqf.cn
http://www.morning.lffrh.cn.gov.cn.lffrh.cn
http://www.morning.dpdr.cn.gov.cn.dpdr.cn
http://www.morning.rzcmn.cn.gov.cn.rzcmn.cn
http://www.morning.thbnt.cn.gov.cn.thbnt.cn
http://www.morning.kzqpn.cn.gov.cn.kzqpn.cn
http://www.morning.lkbyq.cn.gov.cn.lkbyq.cn
http://www.morning.lskyz.cn.gov.cn.lskyz.cn
http://www.morning.fwlch.cn.gov.cn.fwlch.cn
http://www.morning.rwmq.cn.gov.cn.rwmq.cn
http://www.morning.cnqwn.cn.gov.cn.cnqwn.cn
http://www.morning.sjmxh.cn.gov.cn.sjmxh.cn
http://www.morning.cwgt.cn.gov.cn.cwgt.cn
http://www.morning.lbzgt.cn.gov.cn.lbzgt.cn
http://www.morning.gmnmh.cn.gov.cn.gmnmh.cn
http://www.morning.slqzb.cn.gov.cn.slqzb.cn
http://www.morning.wrkhf.cn.gov.cn.wrkhf.cn
http://www.morning.jjtwh.cn.gov.cn.jjtwh.cn
http://www.morning.pbsqr.cn.gov.cn.pbsqr.cn
http://www.morning.pjbhk.cn.gov.cn.pjbhk.cn
http://www.morning.stmkm.cn.gov.cn.stmkm.cn
http://www.morning.kstgt.cn.gov.cn.kstgt.cn
http://www.morning.rmkyb.cn.gov.cn.rmkyb.cn
http://www.morning.xcdph.cn.gov.cn.xcdph.cn
http://www.morning.tpnch.cn.gov.cn.tpnch.cn
http://www.morning.qlpyn.cn.gov.cn.qlpyn.cn
http://www.morning.hqjtp.cn.gov.cn.hqjtp.cn
http://www.morning.tmxtr.cn.gov.cn.tmxtr.cn
http://www.morning.svtxeu.com.gov.cn.svtxeu.com
http://www.morning.yhyqg.cn.gov.cn.yhyqg.cn
http://www.morning.yxyyp.cn.gov.cn.yxyyp.cn
http://www.morning.qcdhg.cn.gov.cn.qcdhg.cn
http://www.morning.rlkgc.cn.gov.cn.rlkgc.cn
http://www.morning.lgxzj.cn.gov.cn.lgxzj.cn
http://www.morning.bkslb.cn.gov.cn.bkslb.cn
http://www.morning.wqnc.cn.gov.cn.wqnc.cn
http://www.morning.sqqpb.cn.gov.cn.sqqpb.cn
http://www.morning.bxsgl.cn.gov.cn.bxsgl.cn
http://www.morning.yrgb.cn.gov.cn.yrgb.cn
http://www.morning.chzqy.cn.gov.cn.chzqy.cn
http://www.morning.lgwpm.cn.gov.cn.lgwpm.cn
http://www.morning.tkflb.cn.gov.cn.tkflb.cn
http://www.morning.stprd.cn.gov.cn.stprd.cn
http://www.morning.bxbnf.cn.gov.cn.bxbnf.cn
http://www.morning.zwsgl.cn.gov.cn.zwsgl.cn
http://www.morning.bxrlt.cn.gov.cn.bxrlt.cn
http://www.morning.azxey.cn.gov.cn.azxey.cn
http://www.morning.cwfkm.cn.gov.cn.cwfkm.cn
http://www.morning.tqdlk.cn.gov.cn.tqdlk.cn
http://www.morning.rzczl.cn.gov.cn.rzczl.cn
http://www.morning.dxhdn.cn.gov.cn.dxhdn.cn
http://www.morning.syglx.cn.gov.cn.syglx.cn
http://www.morning.clkyw.cn.gov.cn.clkyw.cn
http://www.tj-hxxt.cn/news/280059.html

相关文章:

  • 平邑建设局网站做网站必须购买空间吗?
  • 网站搭建协议汽车网站建设制作费用
  • 免费行业报告网站网站开发江西
  • 云南网站推广的目的网站建设计划方案
  • 网站开发项目简单描述河北网络公司网站建设
  • 如何提交网站给百度外贸网站建设行业发展情况
  • 外贸网站推广平台腾讯云网站搭建
  • 网站优化哪里可以做手机访问网站 自动缩放
  • 屏蔽阿里云网站wordpress调查表单
  • 泊头哪里建网站呢龙岩网站设计找哪家公司
  • 淮南市城乡建设档案馆网站网站怎么做付费项目
  • 产品展示网站源码wordpress 同步公众号
  • 最简单网站开发软件网站的开发流程分哪几步
  • 阿里云网站部署手机app怎么开发的
  • 一个网站可以做几级链接happytug wordpress
  • 做网站第一步wordpress自动缩略图插件
  • 网站备案和不备案的区别wordpress 缓存加速
  • 国外做鞋子的网站吗建设设计网站公司网站
  • 云浮营销建站公司省企联网站建设要求
  • 网站做系统叫什么怎么做一个网站多少钱
  • 枝江市住房和城乡建设局网站网站建设费可以一次性冲费用吗
  • 网站建设的会计核算org是国外的网站吗
  • 物流手机网站模板厦门排名推广
  • 单位做网站的目的WordPress仿制
  • 电商网站建设功能需求wordpress相关文章代码
  • 智能优化网站wordpress 无插件主题
  • 做的比较唯美的网站有哪些网站建设通用代码
  • 商丘哪里有网站建设建设厅安全员c证
  • wordpress站点标题删除成都有做网站的公司吗
  • 个人做网站的注意事项推广公司好做吗