# yu-mobile-tool

> Tools for mobile page

Latest version **1.0.2** (published 2020-05-06) · 0 weekly downloads

## Install

```sh
npm install yu-mobile-tool
pnpm add yu-mobile-tool
yarn add yu-mobile-tool
bun add yu-mobile-tool
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-05-06 |
| First published | 2020-05-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kythuen |
| Maintainers | kythuen |
| Keywords | mobile, toast, spin, rem |

## Links

- npm: https://www.npmjs.com/package/yu-mobile-tool
- Repository: https://gitee.com/Kythuen/yu-mobile-tool
- npm.io page: https://npm.io/package/yu-mobile-tool

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-05-06
- 1.0.1 — 2020-05-06
- 1.0.0 — 2020-05-06

## README

# Yu Mobile Tool 移动端常用工具库

## 版本
[![npm package](https://img.shields.io/npm/v/yu-mobile-tool.svg?style=flat-square)](https://www.npmjs.org/package/yu-mobile-tool) [![NPM downloads](http://img.shields.io/npm/dm/yu-mobile-tool.svg?style=flat-square)](http://www.npmtrends.com/yu-mobile-tool) 

## 引入

#### 使用 npm 或 yarn 安装 
```shell
$ npm install yu-mobile-tool --save
或者
$ yarn add yu-mobile-tool
```
```js
import YuMobileTool from 'yu-mobile-tool'
import 'yu-mobile-tool/dist/style.css'
```
#### 浏览器引入
```html
<script src="~filepath/yu-mobile-tool.min.js"></script>
<link rel="stylesheet" href="~filepath/style.css">
```



## 使用

### Toast 文本提示
```
YuMobileTool.Toast(message, duration)
```
#### 参数说明
|     参数     |   类型   | 必填 | 默认值 |       说明       |
| :----------: | :------: | :--: | :----: | :--------------: |
| **message**  | *String* |  是  |   无   |     信息文本     |
| **duration** | *Number* |  否  |  1500  | 显示时长（毫秒） |
#### 使用 npm 或 yarn

```js
import YuMobileTool from 'yu-mobile-tool'
const spin = YuMobileTool.Toast('操作成功', 2000)
```
#### 浏览器引入
```html
<script>
    YuMobileTool.Toast('操作成功', 2000)
</script>
```



### Spin 加载效果
```
const spin = new YuMobileTool.Spin(target, options).show()
```
#### 参数说明
|     参数     |   类型   | 必填 | 默认值 |       说明       |
| :----------: | :------: | :--: | :----: | :--------------: |
| **target**  | *String/DOM* |  是  |   无   |     目标节点     |
| **options** | *Object* |  否  | transparent: true | spin的配置 |
#### 使用 npm 或 yarn
```js
import YuMobileTool from 'yu-mobile-tool'
const spin = new YuMobileTool.Spin('#app', {
    transparent: false,
    show: false
})
spin.show()
spin.hide()
```
#### 浏览器引入
```html
<div class="test-box"></div>
<script>
    const spin = new YuMobileTool.Spin('.test-box')
    spin.show()
    setTimeout(() => {
        spin.hide()
    }, 3000)
</script>
```

---
_Source: https://npm.io/package/yu-mobile-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
