@mpxjs/mpxuse-metadata
v1.0.2
Published
<p align="center"> <a href="https://github.com/mpx-ecology/mpxuse#gh-light-mode-only"> <img src="https://raw.githubusercontent.com/mpx-ecology/mpxuse/main/packages/public/logo-vertical.png#gh-light-mode-only" alt="Mpxuse - Mpx的composition-api的公用方法" widt
Downloads
6
Maintainers
Keywords
Readme
🚀 功能
- 🎪 文档和演示
- 🕶 支持版本: 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
🧱 贡献
参考 如何共建
🌸 感谢
这个项目的灵感来源于以下几个很棒的项目。
👨🚀 贡献者
📄 License
MIT License © 2022 pagnkelly