es6 -- function extension
I. default value of function parameter
//Practice before es6
function log(x,y){
var y=y||'world';
console.log(x,y);
}
log('hello'); // hello world
log('hello',0); //hello world
**: when the parameter y is assigned to false, the default value is valid. This may not be what we want. You may make the following improvemen ...
Posted by max101 on Sat, 14 Dec 2019 11:52:02 -0800
react event binding ES6
Article reference
Summary of ES6 in React.js
Case description
import React from "react"
import { NavBar, Button, Icon } from "antd-mobile"
class Photegraph extends BaseComponent {
// video and mediaStreamTrack are properties of the photographic class
video;
mediaStreamTrack;
// Constructor
constructor (props) { ...
Posted by su1d on Thu, 12 Dec 2019 13:06:50 -0800
Flexible layout, background zoom instance, font shadow - Ctrip mobile app
Main points:
1. Add the display:flex display effect to the parent element that needs to scale the layout, set the value of flex in the child element, and then divide it by proportion. If one subset element is 1 and the other is 2, one takes up one-third and the other two-thirds.
2. Font shadow takes up a lot of memory, not re ...
Posted by badproduce on Thu, 12 Dec 2019 08:04:08 -0800
Record of rare writing method of react
function App1() {
return <Greeting firstName="Ben" lastName="Hector" />;
}
function App2() {
const props = {firstName: 'Ben', lastName: 'Hector'};
return <Greeting {...props} />;
}
<MyComponent message="<3" />
<MyComponent message={'<3'} />
<MyComponent message="hello world" />
...
Posted by duny on Thu, 12 Dec 2019 08:01:18 -0800
Let Vue also use Redux
Last weekend, I saw the source code of Vuex. I was inspired. Why are all Vuex. So Dongtong wrote a plug-in one afternoon to help Vue use Redux
Gayhub Url
Vue-with-Redux
This is a plug-in used to help Vue use Redux to manage state. Redux is a very popular state management tool. Vue with Redux provides you with a way to use Re ...
Posted by AstroTeg on Tue, 10 Dec 2019 04:23:05 -0800
Realization of path path playback function based on Leaflet
Design sketch:
Explain:
1. This function is based on this blog: Path path playback with ArcGIS JS API But there are some small problems: first of all, the car does not move at a constant speed, but the running time of each section is fixed, so it has been modified on this blog; on the other hand, there is no way to set the ...
Posted by xsist10 on Mon, 09 Dec 2019 13:15:25 -0800
Summary of springboot project
The first is the use of thmeleaf
th: attr set property value
https://blog.csdn.net/sun_jy2011/article/details/40215423
Some uses of th tag
https://segmentfault.com/a/1190000009903821
Th: if th: text th: value th: selected, etc
<a href="register.html" title="" th:unless="${session.user} ne null" >Register</a>
...
Posted by RightNow21 on Mon, 09 Dec 2019 07:31:48 -0800
node.js learning notes arrangement
(1) automatic construction of front-end projects
1. Create myProject project files and corresponding folders
var projectData ={
'name':'myProject',
'fileData':[
{
'name':'css',
'type':'dir'
},{
'name':'js',
'type':'dir'
},{
'name':'images',
' ...
Posted by Spitfire on Sun, 08 Dec 2019 22:35:07 -0800
Step by step realization of one of web program information management system -- landing interface realization
Step by step implementation of web program information management system
In the web program, especially in the information management system, the login function must have and be very important. Every learning program development or later work, will meet the needs of landing function. And the most basic function that login func ...
Posted by alarik149 on Sun, 08 Dec 2019 10:22:07 -0800
let solves closure in for loop
scene
Closure generation
Internal function depends on external scope variable, that is, internal holding external reference does not release (extends the life cycle of reference variable, prolongs life)
The essence of variable is actually a placeholder, whose value is the real operation object
Values can be scalars for each ...
Posted by bkanmani on Sun, 08 Dec 2019 08:59:36 -0800