problem description nowadays, the mainstream organization of JS is modular development, but there is a scenario in common development: for example, in a project, the file name of a module is changed , for example: ModuleA.js-> ModuleB.js this wil...
the code is as follows export class SHost_Room{ constructor(rooms){ } } let rooms = [...] let shRooms = new SHost_Room(rooms); I m not good at object-oriented, and I feel like I don t have a train of thought. ...
solution: defines a temporary variable, but it needs to be hidden, otherwise it will be displayed <span v-show="false"> {{message = chat.messages[chat.messages.length-1]}} < span> {{message.content}} similar...
there is a class A , SubA inherits A, but the console reports an error Class constructor xxx cannot be invoked without new how to solve it? A class A{ constructor() {} }; export default A A import A from xxx class SubA extends A{ co...
look at the plug-in source code and stumble upon this writing: type Axis = both | x | none ; import type {Element as ReactElement, Node as ReactNode} from react ; what does type mean? import React from react ; import PropTypes f...
for example, now use the module.exports export module in a test.js file test.js module.exports = { funcA(){ }, funcB(){ this.funcA(); } } two methods, funcA and funcB, are defined internally. Now you want to call the funcA met...
let patentListDefault={ list:[], count:0, isLoading: false, } export const patentDatas = (state=patentListDefault, action = {}) => { let imuDataList; let imuItem; switch(action.type){ case SAVEPATENTLIST : ...
I hope in userLogin : `http: ${ws.url} api login` can introduce url, of ws. How do you write it? var ENV = (function(){ var defaultPage = ; return { pageTitleCustom: , defaultPage: defa...
The directory structure is as follows Code profile.js function showMsg(msg) { alert(msg); } export default {showMsg}; import.js import {showMsg} from ". profile.js"; showMsg("hello world"); .babelrc { "presets...
I want to initialize this.detailImgUrls with concatImgUrls () when initializing the object. Which of the following methods should I use? function concatImgUrls() { return haha ; } export default class Car{ constructor(data){ this.ad...
799 windy version of the infinite horizon of the empty mountain I m done here now. I don t know how to go on. I d like to ask you to help me write a simple demo . let values = item.split( ); let valuesContent = values.join(`keyWord`); I don...
the following code, I used to read the database many times, and the data I got was looped, and after the loop, the database was queried. Finally, after resolve, the result I got was only a small part of the data, and the rest of the data was not resolve...
I, a rookie, recently added some output statements when learning vue-router, to look at the source code as shown below. index.js and install.js are in the same directory, and install.js is referenced in index.js. index.js console.log( index line 2 ...
problem description in the process of developing with react, write components with ES6 syntax as follows const Name = (props) => { this.state = { data: null, visible: false }; const open = (data) => { th...
reducer in redux performs a minus one operation export default (state = initialState, action) => { const {total} = state switch(action.type){ case ActionTypes.ADD: return {...state, total: total + 1} case ActionTypes.SUBT...
<div className={ video }> <div className={ allTasks fl } style = { this.state.current === 0 ? changeColor : changeColor02 ...
Both then and catch in promise can handle exceptions, so what s the difference between them in handling exceptions? Promise.reject( error ).then(()=> {}, val=> { console.log(val); }); Promise.reject( error ).catch(val=> { console...
as shown in the figure above, what is not clear is: why then uses dot syntax, while catch and finally use [] syntax because catch and finally are keywords in js? I don t know what I don t know about this. this is the github address of this polyfi...
THANKS FOR YOUR time! parent component <!--tab swiper--> <li class="tab-item" v-for="(item,index) in processItems" @click="tabProcess(index)" :class="{active: processTabActiveIndex === index}"> ...
problem description for example, the following code: @one() class FaqDetail extends Component {} What does this mean by asking for a detailed explanation? What does it do? why should there be a comment on the class? ...
const routes = [] { path: , name: home , meta: { title: , icon: el-icon-menu , hide: true }, }, { path: monitor , name: , meta: { title: , hide: true }, children: [ { path: mo...
two questions, when logging in, typing mysql-u root-p correctly jumps to the password line, but you can t type the password on the keyboard. You can t log in with a password, but you can log in directly by typing mysql. Is this the wrong place? I have...
I want to make a 404 page. If users type messy URL, they will jump to 404, but Springmvc will not intercept paths without mapping, and then jump directly to Tomcat 404, but it is impossible for users to see Tomcat 404. So is there any good solution ...
problem description cannot write to local after receiving set-cookie, domain is useless http request is shown in figure Server code var cookieParser = require( cookie-parser ); app.use( cookieParser() ); var allowCrossDomain = function(...
socket.io: socket.on( message ,function(msg){ }) socket.on( privite ,function(msg){}) allows ws to distinguish between different message events like this: wss.on( connection , function connection(ws,t) { ws.on( message1 , function (message) {...