@mpxjs/mpxuse-core
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Mpxuse - Mpx的composition-api的公用方法 Mpxuse - Mpx的composition-api的公用方法
Mpx的composition-api的公用方法

NPM version NPM Downloads Docs & Demos 函数数量
GitHub stars

🚀 功能

  • 🎪 文档和演示
  • 🕶 支持版本: mpx2.8版本以上
  • 完全tree shakeable: 仅打包所引用的, bundle size
  • 🦾 Type Strong: TypeScript编写, TS Docs
  • 🔩 灵活配置: 可配置的事件筛选器和目标

🦄 用法

import { useCounter } from '@mpxjs/mpxuse-core'

const { count, inc, dec, set, reset } = useCounter()
defineExpose({
  count, inc, dec, set, reset
})
<template>
  <view>
    <view>Count: {{ count }}</view>
    <button bindtap="inc">
      Increment
    </button>
    <button bindtap="dec">
      Decrement
    </button>
    <button bindtap="inc(5)">
      Increment (+5)
    </button>
    <button bindtap="dec(5)">
      Decrement (-5)
    </button>
    <button bindtap="set(100)">
      Set (100)
    </button>
    <button bindtap="reset">
      Reset
    </button>
  </view>
</template>

参考 所有函数 或者 文档 查看更多

📦 安装

🎩 mpx版本需要2.8以上才支持组合式Composition API!

npm i @mpxjs/mpxuse-core
Demos

可clone仓库执行

pnpm i
cd demo && pnpm i
npm run watch

🧱 贡献

参考 如何共建

🌸 感谢

这个项目的灵感来源于以下几个很棒的项目。

👨‍🚀 贡献者

pagnkelly

📄 License

MIT License © 2022 pagnkelly

Readme

Keywords

none

Package Sidebar

Install

npm i @mpxjs/mpxuse-core

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

46 kB

Total Files

28

Last publish

Collaborators

  • wangshunnn
  • qiushuibai
  • jvzuojing
  • xbup
  • valkeriz
  • yixiaoshan
  • wangzhikai
  • handsomebingo
  • wuxianqiang
  • skyadmin
  • hiyuki
  • commanderxl
  • pagnkelly
  • blackgan3