export function postMethod(data) { const baseURL = process.env.BASE_API axios({ method: post , url: baseURL + img_upload , timeout: 50000, data: data, headers: { loginToken : getLoginToken() } }).then(res =&g...
case: when I need to render the corresponding component according to certain conditions, if I exceed the number of ternary operators, I usually choose to use & & , but if there are too many, I don t think it is beautiful enough. Excuse me, is there a...
an item of react, the function of deleting a photo. After clicking to delete a photo, you need to update the component and get the value of the list again. The two function body requests carry different id, and the request is an asynchronous function. I...
if I enter annual salary above 30K the length judged by the length attribute is 7 . my database code is utf8mb4, and the length of a Chinese character is equivalent to 4 , but if this field is stored in the database, it is equivalent to 19 . add m...
I have a txt file there are 10,000 lines the first line is as follows 27466726----6837605--------398705040011----7605----60664----qq what I want to extract is 27466726 6837605 398705040011 7605 60664 qq the second line is as follows zaistarm---...
recently there are many delete methods used, which always feel strange. Apart from affecting the original array, is there any harm to delete? let a = true; let obj = { name: xiaobi , age: 22 } if(a === true) { delete obj.age } console.log(obj...
case: there is a variable a whose initial value is {} , then a will be a function: console.log as follows a: f (xxx) { xxx } how can I judge the difference between the above two? Thank you ...
Ruan Yifeng tutorial: http: es6.ruanyifeng.com -sharpdo... a.mjs import {bar} from . b ; console.log( a.mjs ); console.log(bar); export let foo = foo ; b.mjs import {foo} from . a ; console.log( b.mjs ); console.log(foo); export l...
for example, get a variable a , and this variable a may be an object returned by the server. a: { name: xiaobe , age: 22, title: xxx } I want to assign name and age of a to b (actually want to take out more attributes) is the...
looking at the introduction to ES6 written by Ruan Yifeng, I found that there was a contradiction in the content. As mentioned in , tail call optimization is only enabled in strict mode, but I use it to call optimized code to run normally without str...
what are the two types of attribute names of an object? ask for guidance. Isn t the previous string a type? there can be many attributes and names in an object. ...
is learning the contents of ES6. I am reading a book published by teacher Ruan Yifeng. I see the contents of the variable declaration about the temporary dead zone. Here is an example: var tmp = 123; if (true) { tmp = abc ; ReferenceError:tmp ...
I don t have much time to contact nodejs. I use nodejs to write the server. Now I write all the interfaces in one file. How to write these interfaces separately in different files, and finally introduce all the interface files into a main file all my...
const scrollTop = document.documentElement.scrollTop scroll bar event, drag the scroll bar to print the scrollTop with different values each time! Didn t you say the value can t be changed? Why is this okay? ...
in the book written by ES6 Ruan Yifeng, there are several times the word "proposal ". I want to know what it means. Does it mean that ES6, which is not yet formal, is just something that someone may do after it is put forward? can the content be ignor...
how many ways can you tell that this object is empty? ...
function pro(){ return new Promise(resolve=>{ resolve() }) } function a(){ return pro().then(res=>{ setTimeout(()=>{ console.log(1) },2000) }) } function b(){ return pro().then(res=>{ ...
now I have two projects, one of which does not consider compatibility, so configure it casually const path = require( path ); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const getConfig = require( . build getConfig )...
there is a solution for react performance optimization in "going deep into the React technology stack ". The original text is as follows (P106-P107 2.6 component performance optimization): as mentioned earlier, shouldComponentUpdate is the most comm...
I instantiated a vue object in a js file, including two local components, and then I exported the objects of these two components with export (note that I am mounting a div of id=app at this time) as follows: const search_input = { props:[..] ...
this is my request code $.ajax({ url:" apis h5 policy.do", type:"post", data:{pageSize:7}, success:function(data){ console.log(data) ...
use webpack4 to build a vue project. CSS Modules, is configured in the configuration file, but it doesn t work and doesn t report an error! the following is the code for the module option in the configuration file module: { rules: [ { ...
according to the previous understanding: introduce styles.scss into angular.json introduce variable.scss into styles.scss use in login.component.scss but an error is reported. How to use global variables without introducing variable.scss indiv...
the following code simulates the use of two threads to manage event loop: import time import asyncio import threading async def task(c, i): for _ in range(i): print(c) await asyncio.sleep(1) return i def thread(loop): -sharp ...
when elementUI uses select, the drop-down position is misplaced and TypeError: PopperJS is not a constructor is reported in vue-popper. [Vue warn]: Error in event handler for "updatePopper": "TypeError: PopperJS is not a constructor&qu...