原创 eggjs(json文件讀取)

1.ejs模板引擎配置 config/plugin.js config/config.default.js 2.service編寫 service/user.js const Service = require('egg').

原创 indexedDB數據庫實踐

export default { indexedDB: window.indexedDB || window.webkitindexedDB || window.msIndexedDB, openDb(dbName, v

原创 centos系統web發佈環境的配置

1.安裝nvm(node包管理器) curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash 2.安裝node nvm

原创 dayjs常用用法

日期格式化 DayJs(date).formate("YYYY-MM-DD HH:mm:ss") HH:24小時制 hh:12小時制 日期運算 DayJs(date).add(num, 'day') DayJs(date).sub

原创 2019阿里前端面試題

2019阿里前端面試題 題目:篩選筆試題 (請在半小時內完成): var arr = [ {name:‘小米1’, value: 1, type: 2, date: ‘2018-06-07T08:00:01.589Z’ },

原创 從零搭建react框架(一)

1.用webpack、babel編譯es6 先裝依賴包: yarn add webpack @babel/core @babel/preset-env babel-loader 新建.babelrc { "presets"

原创 從零搭建react框架(二)

1.項目靜態文件打包配置 圖片文件打包配置 安裝依賴包 yarn add url-loader url-loader webpack.config.js { test: /\.(png|jpg|gif|w

原创 從零搭建react框架(三)

1.生產環境壓縮混淆代碼 yarn add uglifyjs-webpack-plugin webpack.prod.conf.js optimization: { minimizer: [ new Ugli

原创 chrome控制檯中console

在使用谷歌瀏覽器進行前端開發的時候,console作爲控制檯的一個主要方法,相信大家都用過,一般都是用console.log()來輸出部分內容,但是console還有很多強大之處,下面主要說一下console的更重強大的地方:

原创 taro集成rematch的小程序

項目地址:https://github.com/kakaoG/taro-small-program

原创 chrome中直接使用es6的import

查詢一下chrome對import/export的支持情況: 我的chrome版本是69的,發現可以支持。寫個小demo測試一下 test.html <script type="module"> import {foo, nu

原创 git撤銷commit

step1:用git log命令查看你要撤銷的前一個commit的id step2: 用git reset --hard id命令完成撤銷

原创 flex佈局實用技巧

平時工作中常用到的一些flex佈局技巧,先記錄一下

原创 git pull錯誤:refusing to merge unrelated histories

問題場景重現: 我在本地建了個項目,在github新建了項目。現在想把本地項目推送到github新建項目上。 給本地項目添加遠程項目倉庫地址:git remote add origin url 拉取遠程項目代碼:git pull o

原创 react 組件通信

1.父組件向子組件通信 父組件通過props向子組件傳遞需要的信息 parent.jsx import React, { Component } from 'react'; import Son from '../components/T