更新记录

1.0.0(2021-02-20)

1、完成基础切换


平台兼容性

  • 下载后直接看源码,源码有详细介绍
    export default {
        data() {
            return {
                TabCur: 0,
                scrollLeft: 0,
                mainHeight: 200, //全屏或者局部滑动设置的高度
                tabNav: ['通知公告', '政策法规', '新闻动态'],
                list: [], //中间数组
            }
        },
        onLoad() {
            // 首次加载先将notice数组赋值给中间数组,否则刚打开页面是没有内容显示的
            this.list = this.notice
        },
        onReady() {
            //获取屏幕的高度使得全屏左右滑动
            this.mainHeight = uni.getSystemInfoSync().windowHeight; 
        },
        onPullDownRefresh() {
            console.log(`${this.TabCur} -- ${this.tabNav[this.TabCur]}`);//查看当前是在哪个导航下进行刷新
            setTimeout(function() {
                uni.stopPullDownRefresh()
            }, 1000)
        },
        methods: {
            tabSelect(e) {
                this.TabCur = e.currentTarget.dataset.id;
                this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
                // 根据当前TabCur的值判断把哪个数组赋值给list
                this.list = this.TabCur == 0 ? this.notice : this.TabCur == 1 ? this.policy : this.news
                // Math.max(0, index - 1);
            },
            SwiperChange(e) {
                this.TabCur = e.detail.current
                this.scrollLeft = (e.detail.current - 1) * 60
                this.list = this.TabCur == 0 ? this.notice : this.TabCur == 1 ? this.policy : this.news
            }
        }
    }

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问