npm.io
1.0.18 • Published 4 years ago

vue-pets

Licence
MIT
Version
1.0.18
Deps
1
Size
400 kB
Vulns
1
Weekly
0
Stars
1

Vue-Pets

A Vue component to add a cat to your Vue app.

npm GitHub GitHub Repo stars

See also: https://github.com/tonybaloney/vscode-pets/

Installation

npm i vue-pets --save

Usage

<template>
  <VuePets class="vue-pets" />
</template>

<script>
import VuePets from 'vue-pets'
import 'vue-pets/dist/style.css'

export default {
  // ...
  components: {
    VuePets
  },
  // ...
}
</script>

<style>
.vue-pets {
  /* use your custom dimension */
  width: 100%;
  height: 100%;
}
</style>
Props
physics
  • Type:
    {
      ball: { width: number; cx: number; vx: number; cy: number; vy: number; },
      cat: { x: number; y: number; }
      world: { gravity: number; damping: number; traction: number; }
    }
  • Required: false
  • Default:
    {
      ball: { width: 8, cx: 100, cy: 100, vx: 8, vy: 5 },
      cat: { x: 0, y: 0 },
      world: { gravity: 0.2, damping: 0.9, traction: 0.8 }
    }
  • Usage:
    <VuePets :physics="physics">