[source code] update notifier detects whether the npm package is updated ~

Learning objectives Understand the role and usage scenario of update notifierApplication scenario: Check whether npm packages are updated, such as component library updates or other npm package updates, Data preparation Link: https://github.com/yeoman/update-notifier What is an update notifier Prompt package needs to be updated The ess ...

Posted by mr00047 on Thu, 18 Nov 2021 22:05:13 -0800

Teach you to achieve a simple Canvas clock effect

Abstract: today I'll teach you to write a canvas clock case. The effect may look simple without those fancy ones. This article is shared from Huawei cloud community< How to realize a simple Canvas clock effect >, author: Aurora Borealis night.. 1, First look at the effect: Write a clock case of canvas today. The effect may seem relati ...

Posted by Molly on Thu, 18 Nov 2021 20:54:48 -0800

vue3 onomori-03-toRaw,markRaw, life cycle hook, optional provide and inject, combined provide and inject, add response formula to provide and inject, $refs

1,toRaw Returns a proxy object wrapped in reactive or readonly In fact, it is to convert a proxy object into an ordinary object <template> <div> </div> </template> <script> import {ref,reactive,toRaw,readonly,shallowReactive,shallowReadonly,toRefs} from 'vue' export default { name: 'App', setup (props ...

Posted by Joeker on Thu, 18 Nov 2021 08:03:55 -0800

2, Select structure

catalogue 1. Composition of JavaScript 1. Three cores 2. Common methods of window objects 2.if selection structure 3. Multiple if selection structure 4. Nested if selection structure 5.switch selection structure 6. Ternary expression 1. Composition of JavaScript 1. Three cores ESMAScript core syntax (Standard Specification) - > ...

Posted by jikishlove on Thu, 18 Nov 2021 07:04:12 -0800

Quickly learn about Promise of ES6

ECMAScript 6 adds perfect support for Promises/A + specification, namely Promise type. Once launched, Promise became very popular and became the dominant asynchronous programming mechanism. All modern browsers support ES6, and many other browser API s are based on ES6.Promise is a new reference type in ECMAScript 6, which indicates the final co ...

Posted by --ss-- on Thu, 18 Nov 2021 05:04:08 -0800

WebSocket real-time communication front end js

1. Introduction to websocket Similar to HTTP, WebSocket is a network communication protocol. 1.1. Why do I need WebSocket s We already have the HTTP protocol. Why do we need another protocol? What benefits can it bring? The answer is very simple, because the HTTP protocol has a defect: communication can only be initiated by the client, and ...

Posted by jaylearning on Wed, 17 Nov 2021 20:59:54 -0800

vue -- template syntax -- interpolation, instruction, conditional rendering, list rendering, class binding, style binding

1. Interpolation text       < span>Message: {{ msg }}</span>Raw HTML     < span v-html="rawHtml"></span>attribute     < div v-bind:id="dynamicId"></div>event     < a v-on:click="doSomething">...</a&gt ...

Posted by SilverFoxDesign on Wed, 17 Nov 2021 18:07:59 -0800

Basic syntax of JavaScript

1, Write location   you don't need any special software to write JavaScript scripts. An ordinary text editor and a Web browser are enough for programming. Code written in JavaScript must be executed through an HTML/XHTML document. There are currently two ways to call JavaScript. The first method is to put the JavaScript code between t ...

Posted by ketanco on Wed, 17 Nov 2021 15:34:26 -0800

javaScript learning notes 18 days -- object-oriented pattern

When you need to get a certain type of object in large quantities, you can use factory mode Factory mode Steps: Create a functionReturns an object in the function return {} //Create factory function //1. Create function and object attributes function createPerson(name,age,address,className){ //2. Return th ...

Posted by jtp51 on Wed, 17 Nov 2021 05:25:19 -0800

How JS implements a fake new keyword (understand the relationship between new, prototype and constructor)

catalogue General use cases of new keyword: Constructor, constructor, instance, prototype object: What does the new keyword do? Implement a fake new keyword Interpretation of new keyword implementation method General use cases of new keyword: function A(a,b,c){ this.a=a; this.b=b; this.c=c; } let a = new A(1,2,3) console.l ...

Posted by amax on Tue, 16 Nov 2021 03:22:06 -0800