Giter Site home page Giter Site logo

xus-code / vue-reuse Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 11.0 1.29 MB

基于composition-api的hooks函数库

Home Page: https://xus-code.github.io/vue-reuse/

License: MIT License

JavaScript 11.89% TypeScript 88.11%
vue-hooks vue vue3 composition-api vue-reuse

vue-reuse's Introduction

vue-reuse

基于 composition-api 的 hooks 函数库

Lint Test Build Status Deploy Docs license scan codecov

特性

  • 采用typescript实现,提供良好的类型提示
  • 从基础逻辑到业务逻辑,提供多种组合函数(WIP)

参与开发

  • 运行 yarn 安装依赖
  • 运行 yarn lint 校验代码风格
  • 运行 yarn format 格式化所有 ts 代码
  • 运行 yarn cm 执行交互式 commit-msg 生成
  • 运行 yarn test 执行单元测试,可支持 jest 相关参数
  • 运行 yarn docs:dev 启动开发环境下文档系统

目录结构

当前项目采用独立 npm 包的形式来管理,基于 ts 开发;

  1. docs 中使用的是 vuepress 来构建文档项目,每个不同文件夹放置不同分类中的 vue-reuse 文档, 可参照现有案例编写。

  2. __test__ 中存放相应 hooks 的测试用例,如果遇到复杂 hooks 请在 __test__ 下建立相应的文件夹。

  3. scripts 中存放 发布、打包两个脚本

  4. src 下存放 hooks 实现逻辑

  5. src/shared 下存放共用逻辑和类型文件

提交规范

提交信息请严格遵循 angular 团队风格,通过交互式的方式来创建(会在 git-hooks 中进行校验拦截)

vue-reuse's People

Contributors

gtrgosky avatar xuasir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue-reuse's Issues

when should I useEventListener in vue

After I read the doc, i still don't understand when should I useEventListener instead of @event in template.

useEventListener use ref to record the dom element, and use addEventListener to register event to the dom, remove listener after unmonuted, As i know, Vue runtime do all of that if you use @event to register event(Even cache the listener).

useEventListener expose the ref to template, @event expose event handler to template. So why we use useEventListener, is here some trade-off to design this api.

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.