# vue-typed-mixins

> Type safe Vue.js mixins

Latest version **0.2.0** (published 2019-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-typed-mixins
pnpm add vue-typed-mixins
yarn add vue-typed-mixins
bun add vue-typed-mixins
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-11-11 |
| First published | 2018-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 104 |
| Author | katashin |
| Maintainers | ktsn |
| Keywords | Vue.js, TypeScript, mixins, type safety |

## Links

- npm: https://www.npmjs.com/package/vue-typed-mixins
- Repository: https://github.com/ktsn/vue-typed-mixins
- Issues: https://github.com/ktsn/vue-typed-mixins/issues
- npm.io page: https://npm.io/package/vue-typed-mixins

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2019-11-11
- 0.1.0 — 2018-02-27

## README

# Vue Typed Mixins

Type safe Vue.js mixins.

## Example

This has the same capability of canonical Vue [`mixins`](https://vuejs.org/v2/api/#mixins), but is type safe in TypeScript.

```ts
import Vue from 'vue'
import mixins from 'vue-typed-mixins'

const Foo = Vue.extend({
  data() {
    return {
      foo: 'test'
    }
  }
})

const Bar = Vue.extend({
  data() {
    return {
      bar: 123
    }
  }
})

const App = mixins(Foo, Bar).extend({
  data() {
    return {
      value: true
    }
  },

  computed: {
    concat(): string {
      return `${this.foo} ${this.bar} ${this.value}`
    }
  }
})

const vm = new App()
assert(vm.foo === 'test')
assert(vm.bar === 123)
assert(vm.value === true)
assert(vm.concat === 'test 123 true')
```

## License

MIT

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