Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
vue-number-counter
Advanced tools
基于vue2的数字滚动(翻牌)插件
特点1:传给插件的value类型,支持String和Number类型;
特点2:当传给插件的value是Number类型时,支持千位分隔符格式(用于金额、标价等),支持自定义小数位数;
特点3:支持自定义字符表,支持每个字符在激活状态下的样式控制;
npm install vue-number-counter --save
import Vue from 'vue'
// require styles
import 'vue-number-counter/dist/vue-number-counter.css'
import VueNumberCounter from 'vue-number-counter'
Vue.use(VueNumberCounter)
// require styles
import 'vue-number-counter/dist/vue-number-counter.css'
import { VueNumberCounter } from 'vue-number-counter'
export default {
components: {
VueNumberCounter
}
}
<div class='my-wrapper'>
<div class='my-title'>My Number: </div>
<vue-number-counter class='my-number' :value="17842.7129" :option='myOption' />
</div>
https://github.com/hz-ljq/vue-number-counter/blob/master/src/components/Demo.vue
Name | Type | Default | Description |
---|---|---|---|
:value | String/Number | "0" | 要进行动画效果的数字或者字符串 |
:option | Object | duration: 2000, characterWidth: 16, addCharacter: [], replaceCharacterMap: [], decimals: 2, thousandsSeparatorFlag: false | 配置项 |
Name | Type | Default | Description |
---|---|---|---|
duration | Number | 2000(单位:ms) | 字符或数字滚动的动画过渡时间; |
characterWidth | Number | 16(单位:px) | 每个字符所占的宽度; |
addCharacter | Array | [] | 向默认的字符表里追加新的字符,必须是单字符数组,比如:['♪', '∮']; |
replaceCharacterMap | Array | [] | 替换默认的字符表; |
decimals | Number | 2 | 四舍五入小数位数(只在:value参数是Number类型时,才有效); |
thousandsSeparatorFlag | Boolean | false | 是否需要添加千位分隔符(只在:value参数是Number类型时,才有效); |
默认的字符表:[",", "+", "-", ".", "9", "8", "7", "6", "5", "4", "3", "2", "1", "0"];
FAQs
A Vue.js project, (基于vue2的数字滚动(翻牌)插件)
The npm package vue-number-counter receives a total of 0 weekly downloads. As such, vue-number-counter popularity was classified as not popular.
We found that vue-number-counter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.