Summary of vue_shop case study knowledge points (the second day)

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

Insert picture description here

Realization function: add different icons to the circular list

Font icons cycle through the list in order

  1. First define a font object
iconObj:{
    
    

 // 用键和值形式让其一一对应
 // id: 字体图标
 '102':'iconfont icon-user'
 } 

Insert picture description here


After effect
Insert picture description here

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
unique-opened
. Find the attribute in your file and add it.
Insert picture description here

Found the problem: There is a raised part

Insert picture description here
After inspection, it was found that there is a pixel border
Insert picture description here

Just remove the right border line

.el-menu{
    
    
	border-right:none;
}

final effect
Insert picture description here

Realization function: folding and unfolding of the list

Add a button, add @click to it and
Insert picture description here
Insert picture description here
use toggleCollapse function to control its boolean value
Insert picture description here

Because the animation effect is too slow, just cancel the collapse animation and
Insert picture description here
set collapse-transition = false.

Found the problem: the background color did not follow the folding and unfolding

Insert picture description here
It is found that the value of the sidebar has been
Insert picture description here
hard-coded. Change it to follow isCollapse. Whether it is true or not, it can automatically change the width.
Insert picture description here


After effect
Insert picture description here

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
Insert picture description here

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
Insert picture description here
use path as the route's jump address.
Insert picture description here

Click on the user list to display on the right

Insert picture description here
First write the basic content in User.vue,
Insert picture description here
then import the file in the router and add a routing address to
Insert picture description here
achieve the effect:
Insert picture description here

A minor problem was found: the secondary menu was not highlighted after opening the user list page

Insert picture description here
Insert picture description here
Insert picture description here


After effect

Insert picture description here

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
Insert picture description here
the activation status of the link
Insert picture description here

Insert picture description here
Set it as dynamic assignment
Insert picture description here
. Take out the value you just got and activate it.Insert picture description hereInsert picture description here

Implement breadcrumb navigation area

Find the style you want, copy the code, and make certain modifications according to your wishes

Insert picture description here
Import on-demand in element.js
Insert picture description here
Insert picture description here
The effect is displayed at this time:
Insert picture description here

Realize the card view area

Insert picture description here
Insert picture description here
Write some basic layouts for card views and breadcrumbs
Insert picture description here

Search and add area

Insert picture description here
Use the basic layout to
Insert picture description here
Insert picture description here
achieve the effect to
Insert picture description here
Insert picture description here
achieve the effect
Insert picture description here
Obtain the data of the user list
Insert picture description here
Insert picture description here
Insert picture description hereAdd the index column

Insert picture description here
Use scoped slots to control state
Insert picture description here
Case effects
Insert picture description here

Insert picture description here

Insert picture description here
Just change it to false
Insert picture description here

Paging display of data


Insert picture description here
Insert picture description here

Save after change

Insert picture description here
Insert picture description here

Empty input box

Insert picture description here
Insert picture description here
Insert picture description here

Add user dialog

!Insert picture description here

Form validation rules

Insert picture description here

Reset the form after closing the dialog

Click the button to add a new user

Insert picture description here
Insert picture description here

Modify user dialog

Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here

Listen to the close event of the modification event

Insert picture description here

Bind a verification for the OK button

Insert picture description here

Modify user information and submit

Insert picture description here

Delete tooltip

Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_50001396/article/details/113930332