Git Product home page Git Product logo

taro-hooks's Introduction

taro hooks logo

Taro-hooks

PRs WelcomeNPM version NPM downloadsnodelicense Always ready-to-code. dumifather-build lerna FOSSA StatusAll Contributors GitHub commit activity GitHub closed issues GitHub commits since latest release (by date) GitHub Release DateInstall size brotli

简介

Taro而设计的Hooks Library.

文档

vercel
gh-page

使用案例

欢迎大家多多使用, 可将使用案例贡献在Who are using taro-hooks?. 我们会在文档和 README 展示出来.


Taro-hooks weapp

Taro-hooks h5

taro-todolist weapp

taro-todolist h5

特性

  • 全面匹配Taro API.
  • 结合ahooks扩展常用hook.
  • 完整的类型定义文件
  • 按需加载
  • 更易用的方式

taro init

确保当前node>=12.x. 可使用npx taro init projectname选择taro-hooks模板进行初始化项目.

安装

$ npm i taro-hooks --save

使用

import { useEnv } from 'taro-hooks';

注: taro-hooksjs代码默认支持基于ES modulestree shaking. 但你依然可以显式的使用babel-plugin-import去设置按需加载, 设置方式如下:

// babel.config.js
module.exports = {
  plugins: [
    [
      'import',
      {
        libraryName: 'taro-hooks',
        camel2DashComponentName: false,
      },
      'taro-hooks',
    ],
  ],
};

如何在taro 2.x中使用 ?

原则上不推荐在小于3.xtaro项目中使用taro-hooks. 但若有希望可以使用的, 还是提供了接入方式, 但是并不是完全可用, 部分hook还是受到限制.
具体使用方式可参考taro-hooks-demo-for-taro2.x

参与贡献

务必保证预装lerna

$ git clone [email protected]:innocces/taro-hooks.git
$ cd taro-hooks
$ yarn bootstrap
$ yarn start
# 启动小程序预览
$ yarn app:dev
# 启动H5预览
$ yarn app:dev:h5

打开浏览器 - http://localhost:12345
若开启 h5 预览 - http://0.0.0.0:10086
更多贡献详情见官网文档

注: packages/taro-runtime是为了配合文档单独使用生命周期 hook 独立保存的。遇更新会随时更新。无需关心。 father-build同理。

交流讨论

WeChat

wechat code

若失效可点击Welcome to discuss in wechat获取最新二维码

monthly

每个月都会发一篇关于taro-hooks的更新内容. 可至monthly查看全部内容.

Issuehunt

Let's fund issues in this repository

CHANGELOG

本项目遵从 Angular Style Commit Message Conventions,更新日志请查阅 Release, CHANGELOG

友情推荐

项目 描述
taroify Taroify 是移动端组件库 Vant 的 Taro 版本,两者基于相同的视觉规范,提供一致的 API 接口,助力开发者快速搭建小程序应用

License

MIT@innocces

FOSSA Status

Contributors


innocces

💬 📖 👀 📢 🤔 ⚠️ 📦 📋 🎨

more contributors

Gitee

阿酱/taro-hooks

Sponsor

Open Collective

Open Collective

Buy Me A Coffee

taro-hooks's People

Contributors

innocces avatar sssssssugar avatar

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.