JSPM

  • Created
  • Published
  • Downloads 2993
  • Score
    100M100P100Q114431F
  • License MIT

vue-count-to 支持vue2、vue3版本

Package Exports

  • vue3-count-to

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue3-count-to) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vue3-count-to

基于 vue-count-to 升级改造

目的

  • 由于原有作者好像没打算升级版本,故而自己升级维护一下。

兼容

  • 当前版本同时兼容 vue2、vue3,亦能在ts下使用

安装 && 引入

  • 安装
npm install vue3-count-to --save
  • 全局注册
import countTo from 'vue3-count-to';

使用 Vue 2:

Vue.use(countTo);

使用 Vue 3:

import { createApp } from 'vue';

const app = createApp(...);

app.use(countTo);

局部引入

<template>
  <count-to></count-to>
</template>

<script>
import { CountTo } from 'vue3-count-to';

export default {
  components: {
    CountTo
  }
}
</script>
  • 浏览器使用
<script src="https://unpkg.com/vue"></script>
<!-- or -->
<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/vue3-count-to"></script>

文档

参看 vue-count-to 文档。