• Analysis of webpack plug-in principle that you must know


    This article is included in GitHubgithub.com/Michael-lzg… Demo source code addressgithub.com/Michael-lzg… In webpack, a function module that focuses on a specific task in the compilation process of webpack can be called a plug-in. It andloaderThere are the following differences: loaderIs a converter, a file will be compiled into B files, such as: theA.lessConvert toA.css, simple file […]

  • Five ways to simplify react hook


    When writing a custom hook, it’s easy to produce overly complex solutions. This can sometimes lead to erratic behavior, create useless re rendering, or just make it harder to maintain. With that in mind, I’d like to share five ways I’ve found to help simplify customizing the hook. Reduce the number of usestates When you […]

  • Deep understanding of lifecycle hooks in angular 1.5


    The article is translated from:https://toddmotto.com/angular-1-5-lifecycle-hooksFor discussion, visit issue:https://github.com/Jocs/jocs.github.io/issues/3 Lifecycle hooks are simple functions that are called in the specific lifecycle of an angular application component. Life cycle hooks were introduced in angular 1.5, usually used with the. Component () method, and evolved in the following versions, including more useful hook functions (inspired by angular 2). […]

  • Using git hook with husky to check code before git commit


    1、 Git hook Git can trigger custom scripts when certain important actions occur. There are two sets of such hooks: client-side and server-side. The client hook is called by operations such as commit and merge, while the server hook is used for networking operations such as receiving pushed commit.Workflow related hooks: pre-commitThe hook runs before […]

  • The ultimate solution of Vue routing cache


    Author: Walker preface Business often have such a demand, when the page Jump to keep the previous page state and data, convenient to return to processingFor example: a – > B needs caching, a – > C does not need cachingMost of the online examples need to deal with business components, which is very unreasonableSo […]

  • Front end interview questions and answers


    The article will be updated until a job is found. After work, it will be updated according to the situation.There may be some mistakes or misunderstandings in the article. Please point them out and I will correct them in time. Vue interview questions Life cycle function What is Vue lifecycleLife cycle refers to the process […]

  • Vue ssr


    Component lifecycle hook function Should be avoided inbeforeCreateandcreatedCode that has global side effects during the lifecycle.For example:In whichsetIntervalSet timer. In the client side only code, we can set a timer, and thenbeforeDestroyordestroyedIt is destroyed at the end of its life cycle.However, since the destroy hook function is not called during SSR, the timer will remain […]

  • WordPress plug in design


    1、 Introduction to WordPress If you are a student of PHP development, or you know something about blog and CMS, you will know this. Here is Baidu’s explanation: WordPress is a personal blog system, and gradually evolved into a content management system software. It is developed with PHP language and MySQL database. Users can use […]

  • Angular realizes simple dynamic effect


    Simply record the recent requirements, corresponding solutions and learning situation. 1. Add, delete, move up and down to a list2. On the basis of 1, there should be dynamic display effect when moving up and down3. After adding a new object, the page should be displayed instead of manually sliding down the scroll bar For […]

  • Webpack 4.0 breaking down (7) plugin


    1、 Overview of plugin 1.1 function of plug pluginThe mechanism iswebpackIt is based on the event flow frameworktapable, you can refer to the[DOM event model],[life cycle hook in spa model]Or in the node environment[EventEmitter module]To understand its role.pluginThe system is provided for developers to monitorwebpackThe ability to lifecycle and perform specified actions when a specific […]

  • What’s the difference between the code written in the constructor of angular and ngonit?


    Reference to the discussion of stack overflowDifference between Constructor and ngOnInit More than 1000 answers: The Constructor is a default method of the class that is executed when the class is instantiated and ensures proper initialisation of fields in the class and its subclasses. Angular, or better Dependency Injector (DI), analyses the constructor parameters and […]

  • Django — from rendering error information, parameter configuration, local hook and global hook


    1、 From rendering error messages url.py settings.py slightly views.py #View function from django.shortcuts import render,redirect,HttpResponse from app01 import myforms def register(request): if request.method==’GET’: form=myforms.MyForm() return render(request, ‘register.html’,{‘form’:form}) else: form=myforms.MyForm(request.POST) if form.is_valid(): #Storage database print(‘—–‘,form.cleaned_data) return redirect(‘http://www.baidu.com’) else: err=form.errors.get(‘__all__’) print(form.errors.get(‘__all__’)) #{name:[],age:[],__all__:[]} return render(request, ‘register.html’,{‘form’:form,’err’:err})   myforms.py Knowledge to store: Forms component parameter configuration #Customize the display […]