# yhuni-utils

> 适用uniapp的双指手势控制元素旋转插件

Latest version **1.0.5** (published 2023-06-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install yhuni-utils
pnpm add yhuni-utils
yarn add yhuni-utils
bun add yhuni-utils
```

## 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.5 |
| Published | 2023-06-25 |
| First published | 2023-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 于浩 |
| Maintainers | yuhaodawang |
| Keywords | ["utils", "rotate", "uniapp"] |

## Links

- npm: https://www.npmjs.com/package/yhuni-utils
- npm.io page: https://npm.io/package/yhuni-utils

## Recent versions

- 1.0.5 (latest) — 2023-06-25
- 1.0.4 — 2023-06-24
- 1.0.3 — 2023-06-24
- 1.0.2 — 2023-06-23
- 1.0.1 — 2023-06-23
- 1.0.0 — 2023-06-23

## README

# yhuni-utils

## 使用

### 安装

```shell
npm install yhuni-utils
```

### 引入

```javascript
import {yhtouchmove} from 'yhuni-utils'
```

### 为组件添加动态样式并指定touchmove方法

```vue
<view :style="styles" @touchmove="yhtouchmove($event, styles)"><view>
```

**注意**：样例中的styles是用reactive方法创建，如使用ref方法，请传参时传入styles.value

## 样例

```vue
<template>
	<view>
		<view class="box" :style="styles" @touchmove="yhtouchmove($event,styles)"></view>
	</view>
</template>
<script setup>
	import {
		reactive
	} from "vue";
	import {yhtouchmove} from 'yhuni-utils'
	const styles = reactive({})
</script>

<style>
	.box{
		background-color: aquamarine;
		width: 100vw;
		height: 100vw;
	}
</style>
```

## 如果在同一组件中有多个子组件需要使用旋转功能，请参照如下样例
```vue
<template>
	<view>
		<view class="box" :style="style1" @touchmove="yhtouchmove1($event,style1)"></view>
		<view class="box" :style="style2" @touchmove="yhtouchmove2($event,style2)"></view>
	</view>
</template>
<script setup>
	import {
		reactive
	} from "vue";
	import {useyhtouchmove} from 'yhuni-utils'
	const yhtouchmove1 = useyhtouchmove()
	const yhtouchmove2 = useyhtouchmove()
	const style1 = reactive({})
	const style2 = reactive({})
</script>

<style>
	.box{
		background-color: aquamarine;
		width: 50vw;
		height: 50vw;
	}
</style>
```

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