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

推荐订阅源

V
V2EX
Y
Y Combinator Blog
博客园_首页
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
B
Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
WordPress大学
WordPress大学
L
LangChain Blog
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园 - 聂微东
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Help Net Security

博客园 - 赵瑛

如何把一个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>