惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
U
Unit 42
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
腾讯CDC
I
InfoQ
GbyAI
GbyAI
博客园_首页

博客园 - 赵瑛

如何把一个js的代码变成一个.min.js的文件 thinkphp8有一个木马文件链接 thinkphp 可以居中的分页css样式 thinkphp8无法显示验证码的原因之一 php将内容转为word vue点击复制 vue无限加载 mpdf增加字体并进行使用 jquery导出word css清除浮动最好的方法 Elasticsearch同时实现and与or查询 Elasticsearch查询指定字段是否有重复数据 查询并删除Elasticsearch库中指定字段重复的数据 elasticsearch进行and,or多条件组合查询 elasticsearch中的and和or php FTP操作类( 拷贝、移动、删除文件/创建目录 ) mysql重置自增id js 双指放大、拖动图片 php操作elasticsearch数据库的方法
vue简单分页
赵瑛 · 2024-07-11 · via 博客园 - 赵瑛
    const app = {
        data() {
            return {
                info: [], // 存储题目详情数组
                currentPage: 1, // 当前页码
                pageSize: 3, // 每页显示的题目数量
                sjid: sjid
            };
        },
        methods: {
            fetchData(page = 1) {
                axios
                    .get('/api/shijuan/timu_list.html', {
                        params:{
                            p: page,
                            limit: this.pageSize,
                            sjid: this.sjid
                        }
                    })
                    .then(response => {
                        this.info = response.data.data;
                        this.p = response.data.p;
                    })
                    .catch(error => {
                        console.error('Error fetching data:', error);
                    });
            },
            handlePageChange(page) {
                if (page >= 1) {
                    this.currentPage = page;
                    this.fetchData(page);
                }
            }
        },
        mounted() {
            this.fetchData(this.currentPage);
        }
    };
    Vue.createApp(app).mount('#app');
        <div>
            <button @click="handlePageChange(currentPage - 1)" :disabled="currentPage <= 1">上一页</button>
            <span>当前页: {{ currentPage }}</span>
            <button @click="handlePageChange(currentPage + 1)">下一页</button>
        </div>