• React component data flow & & communication between components


    Using react, we first need to know how to transfer data and how components communicate, so as to show the data we want. The following lists all use ES6 grammar. Students who do not understand it need to learn ES6 grammar first. data stream React is a one-way data flow, which is passed from the […]

  • : hover selector controls another element


    Scenario 1: control sibling elements method: :hover+ *Sibling elements that can only be next in order, such as <!– Scenario 1: control sibling elements — > < div class = “one” > Hello < / div > < div class = “two” > Hello < / div > < div class = “three” > How […]

  • Java implementation of child brother tree


    Java implementation of child brother tree 1. Data definition The definition structure of specific child brother tree will not be repeated. @Data @NoArgsConstructor @AllArgsConstructor public class TreeNode { private String value; private TreeNode childNode; private TreeNode broNode; public TreeNode(String value){ this.value = value; } } 2. Implementation of tree @Slf4j public class TreeUtils { /** […]

  • 1. Find sibling elements


    Making navigation display submenu with JS HTML: about skill works works1 works2 works3 Blog Blog1 Blog2 Blog3 calendar contact information other     JS: let aTages = document.getElementsByClassName(‘menutrigger’) console.log(aTages) for(let i = 0; i < aTages.length; i++){ aTages[i].onmouseenter = function(x){ console.log(‘mouseenter’) Let a = x.currenttarget // here, we don’t use x.target or atages [i] because […]

  • JavaScript encapsulation function: get the next / previous sibling node


    requirement: Get the next / previous sibling element node, excluding the text node, etc Solve ie compatibility problem Code implementation: Get the next sibling element node: function getNextElement(element) { var el = element; while (el = el.nextSibling) { if (el.nodeType === 1) { return el; } } return null; } Get the last sibling element […]

  • Common methods of jquery


    jQuery EQ () and get () Get(): jQuery object to DOM object. EQ (): jQuery object builds a new jQuery object.$(selector).eq( 0 ) Find element Filter (selector) reduces the scope of matching and filters in the initial jQuery object collection$(“p”).filter(“.selected, :first”) Find (selector) does not have the contents of the initial collection JQuery () to […]

  • Vue – how to introduce other components into components


    Three steps of using components1: Import componentsImport a custom component name from “component path”;Note that even if the current directory is the same as the component path, it’s best to add “. Otherwise, an error will be reported2: Register componentsThe use of components requires registration. The registration method is export default { components: { The […]

  • JavaScript serialization 28 node relationship demonstration


    1、 Relationship between nodes (1) Get parent node (2) Previous sibling node (3) Next sibling node (4) Gets the first child node in the tag (5) Gets the last child node in the tag (6) Gets the node of the element (7) Gets the node of any sibling Nodes include: label, attribute, text, comment, etc […]

  • One minute understanding of HTML and CSS (Le byte, Le byte Java, Le byte Architecture) 4


    HTML and CSS (4) primary coverage If you want to be an excellent Java Architect, see here → Le byte free open class (Tencent class)If you need more information, please click on the right → this is a road of no return, there is a risk of baldness, please choose carefully! CSS selector In CSS, […]

  • Batch modification of Excel file xlwings in python (2)


    Batch modification of excel by Python Because in the last article, I used xlrd and xlutils to modify excel. After running, the table format and pictures were all gone. My little brother was too busy and had to study it himself. xlwings In the past two days, I checked the library of Python to modify […]

  • 2020-03-05 how mongodb uses aggregation between different types of bonds


    Question: mongodb join on_ id field from String to ObjectIdThere are now two sets of data: User { “_id” : ObjectId(“584aac38686860d502929b8b”), “name” : “John” } 2.Role { “_id” : ObjectId(“584aaca6686860d502929b8d”), “role” : “Admin”, “userId” : “584aac38686860d502929b8b” } I want to join these collection based on the userId (in role collection) – _id ( in user […]

  • JQuery object, basic selector, filter selector


    DOM object converted to jQuery object If the parameter passed to the $(DOM) function is a DOM object, the jQuery method will wrap the DOM object into a new jQuery object <!DOCTYPE html> <html> <head> <meta http-equiv=”Content-type” content=”text/html; charset=utf-8″ /> <title></title> <script></script> </head> <body> < div > element 1 < / div > < div […]