GithubHelp home page GithubHelp logo

dewfall123 / ahooks-vue Goto Github PK

View Code? Open in Web Editor NEW
125.0 5.0 29.0 6.25 MB

🛠️ Vue hooks library.

Home Page: https://dewfall123.github.io/ahooks-vue/

JavaScript 2.50% TypeScript 71.62% Vue 25.27% CSS 0.60%
vue vue-hooks-library hooks vue-next utility-library ahooks vue-hooks

ahooks-vue's Introduction

ahooks-vue

Vue Hooks Library.

Most hooks implementation is original ported from ahooks.

Document

Features

  • Easy to learn and use.
  • Works for both Vue 3 and 2 ( thanks for vue-demi ).
  • Written in TypeScript with predictable static types.

Install

yarn add ahooks-vue

Usage

import { useWorkerFunction } from 'ahooks-vue';

Contributing

Setup ahooks-vue dev environment

  1. Clone the ahooks-vue repo
  2. Install dependencies
    yarn
    
  3. run demo
    yarn dev
    • If it's successful, you should see the following message:
    listening at http://localhost:3000
    

TODO

watchOnce

ahooks-vue's People

Contributors

dewfall123 avatar xiaoyao316 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ahooks-vue's Issues

ready的配置

ready配置有考虑加上吗,感觉还是挺有用的,当一个页面有多个请求,同时又有请求需要等待其他请求完成并且有值时再请求就可以用ready了,没这个配置现在只能通过watch来手动执行run,感觉可以优化一下,但是又看到源码里面有ready: boolean的注释,不知道是不是出于什么原因没有加上。

vue2和vue3得分别写一遍吗

我看你package里面建了vue2、vue3两个文件夹。看看能不能用编译的方式生成两个,不然维护两个版本不很蛋疼吗

文档没代码

code引用不到
image
我们如果做不到那样子的组件,真实效果还有隐藏展示,建议先copy代码到md。
建议把文档放到线上

出现了警告

vue版本 3.X
ahooks-vue 版本: 最新
使用 vite2 官方模版创建项目,只额外引入了ahook-vue ,出现了警告。
找了一晚上没有发现原因
image

vue3的项目引用不到

我用官网vite搭建的vue3项目。
import {useToggle} from '@dewfall/vhooks'
引用不到
Uncaught SyntaxError: The requested module '/@modules/@dewfall/vhooks/dist/index.js' does not provide an export named 'useToggle'

查看 Codepen 示例,报错

点击查看代码示例后,发现合成的代码有问题,无法预览 :-(

另外,如何开启 CodesandBox 预览呢? @dewfall123

image

new Vue({
	el: '#app', 
	import { useSize } from 'ahooks-vue';
import { ref } from 'vue';

  setup() {
    const divRef = ref(null);
    const size = useSize(divRef, {
      onChange: () => {
        console.log('size change');
      },
    });

    return {
      divRef,
      size,
    };
  },
};
})

引入报错

无法找到模块“ahooks-vue”的声明文件。“d:/Projects/UI/vue-app-ts/node_modules/ahooks-vue/dist/ahooks-vue.es.js”隐式拥有 "any" 类型。
There are types at 'd:/Projects/UI/vue-app-ts/node_modules/ahooks-vue/dist/src/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'ahooks-vue' library may need to update its package.json or typings.ts(7016)

image

pr

提了pr麻烦看一下,
useAsync、readme这一条可以删了
同意或者拒绝麻烦点一下,不然我就自己写了,不贡献了
立志把ahooks全抄过来

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.