Giter VIP home page Giter VIP logo

webpack-react's Introduction

Top Langs

🛠 Tech Stack

JavaScript TypeScript

Node.js Vue React NestJs Vite Nuxt Git GitHub Docker

JavaScript工具:

  1. ESLint,代码格式
  2. Lodash.js,功能齐全并且很强大的JavaScript工具库,精简代码;
  3. TypeScript,静态类型

Git 提交规范:

  • feat 增加新功能
  • fix 修复问题/BUG
  • Optimize:需要填写对应需求来源
  • style 代码风格相关无影响运行结果的
  • perf 优化/性能提升
  • refactor 重构
  • revert 撤销修改
  • test 测试相关
  • docs 文档/注释
  • chore 依赖更新/脚手架配置修改等
  • workflow 工作流改进
  • ci 持续集成
  • types 类型定义文件更改
  • wip 开发中

Git 生僻的命令:

  • git update-index --assume-unchanged 文件路径,暂时忽略文件的变更
  • git reset --hard 目标版本号:将版本回退
  • git merge targetbranch:将targetbranch合并到当前分支

Linux命令:

  • scp /path/to/local/file username@server:/path/to/server/directory 终端命令上传文件至服务器

webpack-react's People

Contributors

duxinyues avatar

Watchers

 avatar

webpack-react's Issues

浏览器记录

浏览器记录

在浏览器中存有history和location对象。可以通过其中的一些方法,可以进行导航跳转:

  1. history.pushState

    无需刷新增加页面栈记录,实现改变浏览器路径。

  2. history.replaceState

    修改当前的页面栈的记录。

  3. window.history.go

    加载历史列表中的某个特定具体页面,可传具体的参数,表示跳转到页面栈中的位置。

    该方法只是移动页面栈指针,并不会修改页面栈的记录,就是不会改动到页面栈的数量。

  4. window.history.forward

    跳转到当前页面栈指针所指前一个记录的方法,页面栈的指针前移动一个位置。
    相当于window.history.go(1),调用window.history.forward()不会刷新页面

  5. window.history.back

    在浏览器中后跳,页面栈中指针后移动一个位置,等同于window.history.go(-1),和点击后退按钮一个效果。

  6. window.location.href

    在导航中产产生新的历史记录,将字符串设置到window.location与设置到window.location.href行为一致

  7. window.location.hash

    hash以‘#’开头,通过hash可以修改URL的hash值。

  8. window.location.replace()

    替换或者是修改当前页面栈的记录。

浏览器的相关事件

  1. popstate

    在history.pushState或者history.replaceState产生的页面栈中,当页面发生‘前进’或者‘后退’的时候,就会触发popstate事件,可以通过window.addEventListener()监听这些事件。

        window.addEventListener("popstate", function (event) {
            console.log(event)
        })
    
  2. hashchange

    监听浏览器hash值的变化,语法:

        window.addEventListener("hashchange", function (event) {
            console.log(event);
        })
    
  3. 手动触发事件

    对于popstate事件,只有在移动页面栈指针的时候才被触发,这样不利于我们对事件的控制。

    dispatchEvent方法,可以在不移动页面栈指针的时候控制popstate事件的触发。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.