Vue.js实现分页查询功能

2020-06-16 05:43:59易采站长站整理

{
$.post('/home/BatchDelete', { ids: _id }, function (result) {
if (result > 0) {
location.href = "/home/UserMan";
}
else {
alert("删除失败");
}
});
},
butupdate: function (item, event) //更新
{
//使用jquery打开编辑状态
//$(event.target).parent().parent().find("td:gt(0):lt(4)").each(function (index,item) {
// $(item).html("<input type='text' style='width:50px' value=" + $(item).html() + ">");
//});

//复制对象
// var databack = $.extend({},item);
update_vm.$data.userinfo = item;
layer.open({
type: 1,
area: ["300px", "230px"],
title: "更新",
content: $("#updatecontent"),
btn: ["保存"],
yes: function (index) {
$.post('/home/Update', update_vm.$data.userinfo, function (result) {
//可以把vue.js数据替换把更新后到页面
// vm.$data.mydata.splice(1, 1, update_vm.$data.userinfo);
});
},
cancel: function () //点击关闭按钮
{
// alert(databack.UserName);
// console.log(databack);
}
});
}
}
});

//默认第一个请求
getdata(2,5,vm);
$("#deletebut").click(function () {
//存放需要批量删除的id
var ids = "";
$(".mytable input[type='checkbox']:checked").each(function (index, item) {
ids += $(item).val() + ",";
});
$.post('/home/BatchDelete', { ids: ids }, function (result) {
if (result > 0) {
location.href = "/home/UserMan";
}
else {
alert("删除失败");
}
});
});
});
</script>

关于vue.js的学习教程,请大家点击专题vue.js组件学习教程、Vue.js前端组件学习教程进行学习。