table of Contents
-
- The first time I wrote this kind of summary, it was rather complicated and not logical, I just tried to write
-
-
- Realization function: change the color of selected text
- Realization function: add different icons to the circular list
- Realization function: Keep a sub-menu expanded
- Found the problem: There is a raised part
- Realization function: folding and unfolding of the list
- Found the problem: the background color did not follow the folding and unfolding
- Found a problem: Automatically jump to the home page instead of the welcome page after each login
- Realize the function to jump to different links through the secondary menu
- Click on the user list to display on the right
- A minor problem was found: the secondary menu was not highlighted after opening the user list page
- Found the problem: the default-active at this time cannot be written to death
- Implement breadcrumb navigation area
- Realize the card view area
- Search and add area
- Paging display of data
- Save after change
- Empty input box
- Add user dialog
- Form validation rules
- Reset the form after closing the dialog
- Click the button to add a new user
- Modify user dialog
- Listen to the close event of the modification event
- Bind a verification for the OK button
- Modify user information and submit
- Delete tooltip
-
The first time I wrote this kind of summary, it was rather complicated and not logical, I just tried to write
Realization function: change the color of selected text
active-text-color: Indicates the color of the selected text
After effect
Realization function: add different icons to the circular list
Font icons cycle through the list in order
- First define a font object
iconObj:{
// 用键和值形式让其一一对应
// id: 字体图标
'102':'iconfont icon-user'
}
After effect
Realization function: Keep a sub-menu expanded
After finding the following attributes, find out who the attribute belongs to and find out that it belongs to Menu Attribute
. Find the attribute in your file and add it.
Found the problem: There is a raised part
After inspection, it was found that there is a pixel border
Just remove the right border line
.el-menu{
border-right:none;
}
final effect
Realization function: folding and unfolding of the list
Add a button, add @click to it and
use toggleCollapse function to control its boolean value
Because the animation effect is too slow, just cancel the collapse animation and
set collapse-transition = false.
Found the problem: the background color did not follow the folding and unfolding
It is found that the value of the sidebar has been
hard-coded. Change it to follow isCollapse. Whether it is true or not, it can automatically change the width.
After effect
Found a problem: Automatically jump to the home page instead of the welcome page after each login
Use welcome as a sub-route of /home and redirect it from /home to /welcome automatically
Realize the function to jump to different links through the secondary menu
First, turn on the routing mode for the sidebar, turn the router to true, and
use path as the route's jump address.
Click on the user list to display on the right
First write the basic content in User.vue,
then import the file in the router and add a routing address to
achieve the effect:
A minor problem was found: the secondary menu was not highlighted after opening the user list page
After effect
Found the problem: the default-active at this time cannot be written to death
Get the address value of the secondary menu that is clicked each time, and save its activation status. Save
the activation status of the link
Set it as dynamic assignment
. Take out the value you just got and activate it.
Implement breadcrumb navigation area
Find the style you want, copy the code, and make certain modifications according to your wishes
Import on-demand in element.js
The effect is displayed at this time:
Realize the card view area
Write some basic layouts for card views and breadcrumbs
Search and add area
Use the basic layout to
achieve the effect to
achieve the effect
Obtain the data of the user list
Add the index column
Use scoped slots to control state
Case effects
Just change it to false
Paging display of data
Save after change
Empty input box
Add user dialog
!
Form validation rules
Reset the form after closing the dialog
Click the button to add a new user
Modify user dialog
Listen to the close event of the modification event
Bind a verification for the OK button
Modify user information and submit
Delete tooltip