ES6 與 React

Node和NPM
/*安裝npm*/
npm install
npm install <package>
npm install -g <package>react

/*更新安裝包*/
npm update <package>
npm update -g <package>webpack

卸載安裝包
npm uninstall <package>
npm uninstall -g <package>git

React項目搭建命令
/*安裝React
npm install -g create-react-appweb

/*建立項目*/
create-react-app my-appnpm

/*進入項目所在的目錄*/
cd my-appredux

/*啓動項目*/
npm start數組

/*安裝依賴*/
npm install數據結構

/*編譯項目*/
npm run buildapp

安裝webpack和webpack-cli
npm install --save-dev webpack webpack-cli -g函數

GIT GUI(可視化工具)
https://blog.csdn.net/qq_15509267/article/details/83617029

 GUI 教程

https://www.liaoxuefeng.com/wiki/896043488029600

/*初始化倉庫*/
git init

/*添加文件到本地倉庫*/
git add .(文件name)

/*添加文件描述信息*/
git commit -m "first commit"

/*連接遠程倉庫,建立主分支*/
git remote add origin + 遠程倉庫地址

/*把本地倉庫的變化鏈接到遠程倉庫主分支*/
git pull origin master

/*把本地倉庫的文件推送到遠程倉庫*/
git push -u origin master


從GitHub向本地down文件
git clone '代碼倉庫的SSH地址'

打包工具
webpack是一個打包工具
https://blog.csdn.net/u010289890/article/details/82663082


taro和dva
https://taro.aotu.io
https://dvajs.com
/*安裝taro (cnpm爲淘寶鏡像)*/
cnpm install -g @tarojs/cli

/*建立項目*/
taro init taro-demo

/*安裝與 react-redux*/
cnpm install --save redux @tarojs/redux @tarojs/redux-h5 redux-thunk redux-logger

/*安裝dva*/
cnpm install --save dva-core dva-loading

 

命令:var let const數組解構賦值:let [a = 1] = [];let [a, b, c] = [1, 2, 3];let [a, b, c] = new Set([1, 2, 3]);對象解構賦值:let { log, sin, cos } = Math;let { a, b } = { a: 1, b: 2 };let x; ({ x } = { x: 1 });字符串解構賦值const [a, b, c] = '123';let { length: len } = '123';函數參數解構賦值function func([x, y])var f = v => v; 等同於 var f = function (v) { return v; };(() => { console.log(1); })();遍歷 Map 結構const items = new Map();items.set(1, 2);items.set(3, 4);for (let [key, value] of items) { key + value } 或者 [[1, 2], [3, 4]].map(([a, b]) => a + b);輸入模塊的指定方法const { fn, func } = require("source-map");字符的 Unicode 表示法let txt = "\u0061";let txt = "\u{0061}";字符串的遍歷器接口(let i of text) 模板字符串,用反引號(`)標識字符串中嵌入變量let name = "micro";var txt = `Name ${name}`數據結構 Setconst s = new Set([1, 2, 3, 4, 4]);const s = new Set();[2, 3, 5, 4, 5, 2, 2].forEach(x => s.add(x));for (let i of s)Class 語法class Func {    constructor() { }    add(x, y) {        return x + y;    }    get prop() {        return 0;    }    set prop(value) {        console.log(value);    }}let fn = new Func();fn.add(1, 2)let Func = new class {}靜態方法和屬性class Func {    static prop = 1;    static add(x, y) {        return x + y;    }        }私有方法和私有屬性class Func {    add(x, y) {        fn.call(this, x, y);    }}function fn(x, y) { }類繼承靜態方法class Fn extends Func { }        Module 的語法<script type="module"></script>

相關文章
相關標籤/搜索