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

在网站中搜索关键字个人推广app的妙招

在网站中搜索关键字,个人推广app的妙招,四网合一网站建设,百度网站优化哪家好uni-app开发的页面跳转全局加载中首先需要下载插件创建加载中页面组件app.vue页面中监听跳转首先需要下载插件 https://ext.dcloud.net.cn/plugin?id20613 创建加载中页面组件 <!-- 全局自定义加载中 --> <template><view v-if"visible" class&qu…

uni-app开发的页面跳转全局加载中

    • 首先需要下载插件
    • 创建加载中页面组件
    • app.vue页面中监听跳转

首先需要下载插件

https://ext.dcloud.net.cn/plugin?id=20613

创建加载中页面组件

<!-- 全局自定义加载中 -->
<template><view v-if="visible" class="global-loading"><!-- 使用CSS实现加载动画,避免性能问题 --><xtf-loader6 style="margin-top: 30rpx;"></xtf-loader6><xtf-loader10 class="item" style="margin-top: 10rpx;"></xtf-loader10><text class="loading-text">{{ text }}</text></view>
</template><script>
export default {data() {return {visible: false,text: '加载中...'}},methods: {show(text) {this.text = text || '加载中...'this.visible = true},hide() {this.visible = false}}
}
</script><style scoped>
.global-loading {position: fixed;top: 0;left: 0;right: 0;bottom: 0;background: rgba(255, 255, 255, 1);display: flex;flex-direction: column;justify-content: center;align-items: center;z-index: 9999;
}.loading-spinner {display: flex;margin-bottom: 16px;
}.spinner-dot {width: 12px;height: 12px;margin: 0 6px;background-color: #007aff;border-radius: 100%;animation: spinner-bounce 1.4s infinite ease-in-out both;
}.spinner-dot:nth-child(1) {animation-delay: -0.32s;
}.spinner-dot:nth-child(2) {animation-delay: -0.16s;
}@keyframes spinner-bounce {0%, 80%, 100% { transform: scale(0);opacity: 0.5;} 40% { transform: scale(1);opacity: 1;}
}.loading-text {font-size: 14px;margin-top: 15px;color: #666;
}
</style>


这个就是那个插件里面的小组件,可以用在加载中进行显示,插件下载安装好后,就这样直接使用代码去调用,不用再多做别的配置。

app.vue页面中监听跳转

<template><view><global-loading ref="globalLoading"></global-loading><router-view /></view>
</template>
<script>import GlobalLoading from "@/components/loading/loading.vue"export default {onLaunch: function() {console.log('App Launch')// 初始化路由拦截this.setupRouterInterceptor()},onShow: function() {console.log('App Show')},onHide: function() {console.log('App Hide')},components: { GlobalLoading },methods:{showGlobalLoading(text) {this.$refs.globalLoading.show(text)},hideGlobalLoading() {this.$refs.globalLoading.hide()},setupRouterInterceptor() {const interceptorMethods = ['navigateTo','redirectTo','reLaunch','switchTab']interceptorMethods.forEach(method => {uni.addInterceptor(method, {invoke: (args) => {this.showGlobalLoading('加载中...')return args},success: () => {// 确保页面切换完成后再隐藏setTimeout(() => {this.hideGlobalLoading()}, 1500)},fail: (err) => {this.hideGlobalLoading()console.error('导航失败:', err)},complete: () => {// 兜底确保loading关闭setTimeout(() => {this.hideGlobalLoading()}, 2000)}})})},}}
</script><style>/*每个页面公共css */
</style>

这样就可以实现页面跳转的时候进行加载中显示了!!!

http://www.dtcms.com/wzjs/432222.html

相关文章:

  • 微商网站制作抖音关键词查询工具
  • 上海 建网站百度推广和优化哪个好
  • 网站建设的类型百度下载安装app
  • 怎样在百度免费做网站培训优化
  • 食品网站策划免费网站java源码大全
  • 如何上传网页到网站网络推广100种方法
  • 做博客网站如何盈利中小企业网站
  • 推荐专业做网站公司seo优化便宜
  • 做网站赚大钱百度热搜榜排名今日第一
  • tomcat安装wordpress北京网站快速优化排名
  • 网站开发文档网站互联网广告营销方案
  • 一个人可以做网站吗网站推广多少钱一年
  • 易县做网站的在哪软文广告示范
  • 在哪里可以做自己的网站网络销售是干嘛的
  • 网站建设公司怎么选郑州seo服务
  • 杭州网站关键词长春网络推广优化
  • 建筑业招聘网站2345电脑版网址导航
  • 网站开发的目的百度云官方网站
  • 青岛网站建设-中国互联sem是什么品牌
  • 管理系统怎么做广州seo学徒
  • 长沙独立站建站公司重庆百度总代理
  • 国家城乡建设部信访网站网络营销软件哪个好用
  • 金华企业网站建站模板seo网站优化方案
  • 网站建设方案书ppt淘宝的17种免费推广方法
  • 自己的网站怎么推广昨日凌晨北京突然宣布重大消息
  • 外贸网站如何seo最新病毒感染什么症状
  • 动态网站建设实例教程seo可以提升企业网站的
  • 网站源码推荐31省市新增疫情最新消息
  • 摄像机怎么在自己家网站做直播产品推广策划
  • 高州网站建设sem竞价培训