[vue] Usage of Mixins in vue (jeecg-boot as an example):


1. Jeecg-boot itself only has JeecgListMixin.js

Mixin is to 公共方法process some pages together (save repetitive code and facilitate maintenance).
优先级:The method in the page is >the method in Mixin = "so pay attention to search when maintaining

insert image description here

Second, use Mixin:

注意:The js file imported by import here must be exported in the js file
insert image description here

insert image description here
insert image description here

3. Detailed explanation of mixins:

[1] Since the interfaces and parameters of each project are different => js is introduced here for processing, and it is not processed in Mixin (Mixin only does public data processing)

insert image description here
insert image description here
insert image description here
insert image description here

【2】Public page dictionary

insert image description here
insert image description here
insert image description here

[3] Different GET/POST for different request methods in the solution

【1】How to load the list:
insert image description here
insert image description here
【2】Delete and other methods:
insert image description here
【3】When resetting, it will display today by default:
insert image description here

Guess you like

Origin blog.csdn.net/weixin_53791978/article/details/132013267