sims-tool
sims-tool is a basic tool library, provide common methods used in development. Simple and Clear.
安装
npm install --save sims-tool or
yarn add sims-toolUse
Node
const $tool = require("sims-tool") Vue or React
import $tool from 'sims-tool' Methods
$3
provide a the escaped string, escaped it and return it. case: >,return >
$3
provide a Date or String, format it to yyyy-mm-dd hh:mm:ss and return it
$3
return a the unique id
$3
subtract the two date return time difference
$3
check phone format return boolean
$3
removes the character specified at the end of the string
$3
judge a variable whether is empty
vue global registration
``
js
import $tool from 'sims-tool'
vue.prototype.$tool = $tool
``