小程序--导航栏切换(tab切换)
摘要:1.展示 2.代码片段 WXML 导航栏 <view class="swiper-tab"> <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">未完成</vi
阅读全文
posted @
2020-05-13 13:19
萬事順意
阅读(1399)
推荐(0)
vue--导航守卫
摘要:在做Vue项目时,需要在路由跳转的时候做些什么,普遍需求就是登录验证,vue-router提供了导航守卫。 导航守卫分为全局导航守卫和局部导航守卫。 全局导航守卫:router.beforeEach 当从一个路由跳转到另一个路由的时候触发此守卫,这个守卫也叫全局前置守卫,所以它是跳转前触发的。任何路
阅读全文
posted @
2020-05-13 11:50
萬事順意
阅读(173)
推荐(0)
小程序--公共组件
摘要:tab组件为例 1.在项目下建一个components(组件)的文件夹 2.新建组件文件夹 生成同名page 3.代码片段 tab.json { "component": true, "usingComponents": {} } tab.js //跳转到首页 gohome(){ wx.switch
阅读全文
posted @
2020-05-13 11:48
萬事順意
阅读(670)
推荐(0)
小程序--倒计时3秒
摘要://JS部分 data:{ countDownNum: 3, timer: '', //定时器 } //定时器 countDown: function () { let that = this; let countDownNum = 3; //获取倒计时初始值 that.setData({ coun
阅读全文
posted @
2020-05-12 11:33
萬事順意
阅读(1203)
推荐(0)
小程序--滚动公告栏
摘要:1 //JS 部分 data: { 2 text: "公告公告公告公告公告公告公告公告公告公告公告公告公告公告", 3 animation: null, 4 timer: null, 5 duration: 0, 6 textWidth: 0, 7 wrapWidth: 0 8 }, 9 /** 1
阅读全文
posted @
2020-05-12 10:36
萬事順意
阅读(925)
推荐(0)
JS--判断是否在某个时间段内(几点至几点)
摘要:1 function time_range(beginTime, endTime) { 2 var strb = beginTime.split(":"); 3 4 if (strb.length != 2) { 5 return false; 6 } 7 8 var stre = endTime.
阅读全文
posted @
2020-05-12 10:25
萬事順意
阅读(3351)
推荐(0)