sims-tool v1.2.2
sims-tool
sims-tool is a basic tool library, provide common methods used in development. Simple and Clear.
安装
npm install --save sims-tool
oryarn add sims-tool
Use
Node
const $tool = require("sims-tool")
Vue or Reactimport $tool from 'sims-tool'
Methods
escapeStr(string)
provide a the escaped string, escaped it and return it. case: >,return >
escapeDate(date)
provide a Date or String, format it to yyyy-mm-dd hh:mm:ss and return it
createUid()
return a the unique id
subDate(startDate,endDate)
subtract the two date return time difference
isPhone(str)
check phone format return boolean
trimEnd(str)
removes the character specified at the end of the string
isEmpty(arg)
judge a variable whether is empty
vue global registration
import $tool from 'sims-tool'
vue.prototype.$tool = $tool
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago