为中华之崛起而读书

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
</head> <body>
<div id="t">
<table>
<tr>
<td>id</td>
<td>name</td>
<td>操作</td> </tr>
<tr v-for="k in list">
<td>{{k.uid}}</td>
<td>{{k.uname}}</td> <td>{{k.status}}</td> <td> <input type="button" @click="a()" v-if="k.status==0" value="保存"/>
<input type="button" v-on:click="b()" v-if="k.status==1" value="舍弃"/>
</td> </tr> </table>
<span v-if="this.current>1">
<input type="button" v-on:click="fnone()" v-if="true" value="首页"/> </span>
<span v-if="this.current-1>=1">
<input type="button" v-on:click="fnprev()" v-if="true" value="上一页"/> </span>
<span v-if="this.current+1<=total"> <input type="button" v-on:click="fnnext()" v-if="true" value="下一页"/>
</span>
<span v-if="this.current!=total"> <input type="button" v-on:click="fnlast()" v-if="true" value="尾页"/>
</span> </div> </body>
<script>
var nv=new Vue({
el:"#t",
data:{ list:[],
current:1,
total:1 }, methods:{
fnnext:function(){
if(this.current+1<=this.total){
this.current=this.current+1;
this.fnboss();
} },
fnprev:function(){ if(this.current-1>=1){
this.current=this.current-1;
this.fnboss();
} },
fnone:function(){
this.current=1;
this.fnboss(); },
fnlast:function(){
this.current=this.total;
this.fnboss(); }, fnboss:function(){
axios.get(`http://localhost:8080/list/${this.current}`).then(obj=>{
console.log(obj);
this.list=obj.data.data.content;
this.total=obj.data.data.totalPages; }) } },
created:function(){
this.fnboss();
} }) </script>
</html>

用vue实现列表分页和按钮操作的更多相关文章

  1. Vue笔记--通过自定义指令实现按钮操作权限

    经常做中后台系统,此类系统的权限是比较重要,拿自己做过的一些项目做个笔记. Vue实现的中后台管理系统.按钮操作权限的空置一般都是通过自定义指令Vue.directive. <el-button ...

  2. django rest_framework vue 实现用户列表分页

    django rest_framework vue 实现用户列表分页 后端 配置urls # 导入view from api.appview.userListView import userListV ...

  3. vue+element-ui 实现分页(根据el-table内容变换的分页)

    官方例子 官方提示: 设置layout,表示需要显示的内容,用逗号分隔,布局元素会依次显示.prev表示上一页,next为下一页,pager表示页码列表,除此以外还提供了jumper和total,si ...

  4. 为什么你需要在用 Vue 渲染列表数据时指定 key

    本文改写整理自一篇博文,原文链接如下: Why you should use the key directive in Vue.js with v-for Application state and ...

  5. 基于Metronic的Bootstrap开发框架经验总结(2)--列表分页处理和插件JSTree的使用

    在上篇<基于Metronic的Bootstrap开发框架经验总结(1)-框架总览及菜单模块的处理>介绍了Bootstrap开发框架的一些基础性概括,包括总体界面效果,以及布局.菜单等内容, ...

  6. PHP+jQuery 列表分页类 ( 支持 url 分页 / ajax 分页 )

    /* ******* 环境:Apache2.2.8 ( 2.2.17 ) + PHP5.2.6 ( 5.3.3 ) + MySQL5.0.51b ( 5.5.8 ) + jQuery-1.8.3.mi ...

  7. JS-001-单选复选按钮操作

    此文主要针对 web 页面中常见元素(例如:单选按钮.复选按钮)的 JavaScript 操作,进行简单的源码示例演示,敬请小主们参阅.若有不足之处,敬请大神指正,不胜感激! 话不多言了,直接上码: ...

  8. jsp 条件查询、列表分页

    条件查询 dao //根据搜索条件筛选数据 public List<User> GetUserBySearch(String userName, String sex) throws SQ ...

  9. 微信小程序开发——列表分页上拉加载封装实现(订单列表为例,订单状态改变后刷新列表滚动位置不变)

    业务需求: 业务需求是给订单列表添加分页功能,也就是上拉加载这种每次只请求加载固定数量的数据. 需求分析: 对业务来说就是简单的分页上拉加载,但是对于技术实现来说,除了要处理分页数据的累加加载,还要处 ...

随机推荐

  1. c#中的new和override的实例

    using System; using System.Collections.Generic; using System.Linq; using System.Text; /* 简单说,抽象方法是需要 ...

  2. hibernate笔记

    1.hibernate中的list()遍历方法和iterator()遍历方法之间的区别 1:返回的类型不一样,list()返回List, iterate()返回Iterator,2: 获取数据的方式不 ...

  3. RobotFrameWork框架介绍与安装

    一.RobotFrameWork介绍 1.简称RF,基于python研发的一款自动化测试框架.开源.跨平台的测试框架 2.RF是基于RF基金来研发的一款软件,目前已完全能够在python3环境下应用 ...

  4. springboot 打成的jar包在ClassLoader().getResource方法读取文件为null

    1.属性文件如下: 10001=错误 2.文件读取主要代码 // getResource方式 URL resourceURI = getClass().getClassLoader().getReso ...

  5. 编程用泰勒公式求e的近似值,直到最后一项小于10的负6次方为止。

    #include<stdio.h>#include<math.h>void main(){ int n; float j=1.0,sum=1.0; for(n=1;;n++) ...

  6. 洛谷 P1717 钓鱼 题解

    每日一题 day46 打卡 Analysis 首先通过题目我们不难发现,为了得到最优解,那么就不能把时间浪费在路上,也就是说不能走回头路.然后很容易可以发现,在每个时刻在不同的鱼塘钓到的鱼的数量是不同 ...

  7. JAVA常用处理数据

    price(350)*(10/100) price.multiply(maxPayIntegrateRate.divide(new BigDecimal("100.0")) max ...

  8. “知乎杯”2018 CCF 大学生计算机系统与程序设计竞赛 贪心算法(greedy)

    --> 贪心算法 1)题解 •        分别用V0.V1和V>=2表示度为0.1以及至少为2的顶点集合 •        对于每个顶点,维护三个属性: •        degree ...

  9. 时间datetime模块

    datetime模块 import datetime --时间加减的模块 #返回当前时间 print(datetime.datetime.now()) --2019-09-28 17:22:14.54 ...

  10. Codeforces 1163E Magical Permutation [线性基,构造]

    codeforces 思路 我顺着图论的标签点进去的,却没想到-- 可以发现排列内每一个数都是集合里的数异或出来的. 考虑答案的上界是多少.如果能用小于\(2^k\)的数构造出\([0,2^k-1]\ ...