# hb-switch

> One switch component

Latest version **0.2.6** (published 2020-06-08) · 0 weekly downloads

## Install

```sh
npm install hb-switch
pnpm add hb-switch
yarn add hb-switch
bun add hb-switch
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2020-06-08 |
| First published | 2020-06-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 161.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | linyang012 |

## Links

- npm: https://www.npmjs.com/package/hb-switch
- npm.io page: https://npm.io/package/hb-switch

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [vuex](https://npm.io/package/vuex.md) ^3.4.0
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [vue-router](https://npm.io/package/vue-router.md) ^3.2.0

## Recent versions

- 0.2.6 (latest) — 2020-06-08
- 0.2.5 — 2020-06-08
- 0.2.4 — 2020-06-08
- 0.2.3 — 2020-06-08
- 0.2.2 — 2020-06-05
- 0.2.1 — 2020-06-05
- 0.2.0 — 2020-06-05
- 0.1.9 — 2020-06-05
- 0.1.8 — 2020-06-05
- 0.1.7 — 2020-06-05
- 0.1.6 — 2020-06-05
- 0.1.5 — 2020-06-05
- 0.1.4 — 2020-06-05
- 0.1.3 — 2020-06-05
- 0.1.2 — 2020-06-05

## README

# hb-switch

## Project setup
```
npm install hb-switch -S
```

### 在 main.js 文件中引入插件并注册
```
import Switch from 'hb-switch'
Vue.use(Switch)
```

### 在项目中使用 hb-switch
```
<template>
  <hb-switch :title="('默认 false')"></hb-switch>
</template>
<script>
  export default {
    data () {
      return {
        textHtml: '<span style="color:red">我是红色</span>'
      }
    },
    methods: {
        onClick (newVal, oldVal) {
          console.log(newVal, oldVal)
        }
      }
  }
</script>
```

### 特点
```
简单易用，UI在原插件基础上优化增加了圆角和过渡动画
提供以 npm 的形式安装提供全局组件
```

### 选项
```
你可以通过在所在的元素上设置以下属性来配置hb-switch
textHtml：配置颜色，如<span style="color:red">我是红色</span>
disabled：禁用状态，如disabled
```

### 事件
```
@click="onClick"点击事件
<hb-switch disabled :title="textHtml" @click="onclick"></hb-switch>
```

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