当前位置:网站首页>Edit delete user
Edit delete user
2022-07-27 05:40:00 【My name is Lili】
1: Add users .
Write the interface in the background , Foreground writing method , And then again user The method bound by the button is called in the component . You can successfully add .
2: Edit the user's implementation
There must be two interfaces in the background , One is based on the current id Get users , The other is updated .
Then the front desk api Add two methods to call these two background interfaces
Then click this button in the component , call handAdd Method open the pop-up window and use this window to user Reassign , otherwise , There is always id Of , You can't go, new , Then open the window, and then according to the query id Assign a value .
Then after assignment , I need to judge at the button , Click OK to go to add , Or editor ( Judge underline id Whether there is , Equal to empty, go and add , It is not equal to empty editing ----- Use the interface the day before yesterday to query id Methods )
Last , I'm just defining a updaeData Method can call the interface to update data .
3: Processing roles : binding
3: Delete user
Background interface There should be a prompt to delete elementui OK to cancel Pop-up windows , Then trigger the foreground deletion method , The deletion succeeded , But there is one bug
Bug describe : When I have two more pages of data , Delete the data on the second page , The first page of data is not automatically displayed , The empty data on the second page is displayed . There is only one page left , The page number is still the second .
Solutions :
(1) Find a variable and record the total number of pages ,
(2) Then determine whether the current page is larger than the total number of pages before obtaining the method of user list , If the current page is larger than the total number of pages , Let him equal the total number of pages .
(3) In the user list method, if you calculate Divide the total number of entries by the number of entries on a page , And then round it up
this.totalPage = Math.ceil(total/pageSize) Then calculate after each successful deletion
this.totalPage = Math.ceil((this.total-1)/this.pageSize).
That's it .




边栏推荐
- 自我理解思考
- OSI七层模型和TCP/IP四层(TCP与UDP)(笔记)
- Permission display - dynamic list on the left
- 维持登录,路由跳转
- 程序环境和预处理(下):#define、#undef、命令行编译、条件编译、文件包含(超全整理,建议收藏!!!
- JS基础知识--每日学习总结①
- C language string function: StrCmp, strncpy, strncat, strncmp, strstr, strtok, strError
- C语言指针入门详细介绍
- JS==操作符的强制类型转换规定
- User login - and create and verify SMS verification code
猜你喜欢

Hi3516dv300 environment setup

First knowledge of C language - why does every C program have a main function

页面的基本布局

分享一道关于程序编译过程的选择题(内含编译过程浅谈,符号表的形成合并过程)

Trying to evolve_ My first CSDN blog

Source code of document type full-text retrieval knowledge base management system

封装JWT

背景图片相关应用-铺满,自适应

c语言字符串函数上:strlen、strcpy、strcat

函数和箭头函数
随机推荐
编辑删除用户
First knowledge of C language -- constants and variables
程序环境和预处理(上):一个程序是怎么成功运行的?
迭代器和生成器
JS如何判断一个对象是否属于一个类
cmd命令和npm命令
软件测试面试题(重点)
First knowledge of C language - string + escape character + comment
sql_mode严格模式(ANSI/TRADITIONAL/STRICT_TRANS_TABLES)
set集合
First acquaintance with C language - first acquaintance with pointer
Looking at the PK of alphago and Li Shishi from a deep perspective
进制的特性
信息学奥赛一本通1178题——成绩排序
XSS知识点
洛谷陶陶摘苹果
mysql 取消外键关联约束
Hi3516dv300 environment setup
==,===,Object.is
JS中深拷贝和浅拷贝的区别