0.1.3 • Published 4 years ago

web-pet v0.1.3

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

web-pet

npm (scoped)

在页面上打瞌睡的一只小猫咪,负责陪伴和引导用户。记录用户行为和设备页面性能信息,并上报每次的统计信息。

简体中文 | English

启动

npm run dev

构建生产

npm run build

安装

使用 npm:

npm install web-pet

使用script标签:

<script src="/dist/webPet.min.js"></script>

例子

import WebPet from "web-pet";

const firstPet = new WebPet();

const opt = {
  ...
}

const otherPet = new WebPet(opt);

WebPet 配置

你可以个性化配置生成自定义属性的宠物。

{
  name: '二狗',
  footPrint: false,
  report: true,
  reportUrl: "http://localhost:3000/api/report",
  action: {
    firstGreet: false,
    randomMove: true,
    randomSay: true
  },
  server: {
    answer: {
      url: "http://localhost:3000/api/answer",
      dataPath: "data.msg",
      separator: "."
    }
  },
  on: {
    create: function(){ },
    mounted: function(){ }
  }
  ...
}

License

MIT

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago