Metrics
0
Watch 6 Star 3 Fork 1

大猩猩X / vxe-utilsJavaScriptMIT

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
用于 Vue 全局安装 xe-utils spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

vxe-utils

npm version npm build npm downloads gzip size: JS npm license

Installing

npm install xe-utils vxe-utils

Get on unpkg and cdnjs

<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/xe-utils"></script>
<script src="https://cdn.jsdelivr.net/npm/vxe-utils"></script>

Example

Run this demo on jsfiddle.net

import Vue from 'vue'
import XEUtils from 'xe-utils'
import VXEUtils from 'vxe-utils'

// options:
// Vue.use(VXEUtils, XEUtils, { mounts: ['cookie', 'browse', 'locat'] })
// this.$cookie()
// this.$browse()
// this.$locat()

Vue.use(VXEUtils, XEUtils)
<template>
  <h1>{{ userName }}</h1>
  <div>{{ $utils.toDateString(startDate, 'yyyy-dd-MM HH:mm:ss') }}</div>
  <div>{{ endDate }}</div>
</template>
<script>
export default {
  data () {
    return {
      userName: null,
      startDate: new Date(),
      endDate: null
    }
  },
  created () {
    this.userName = this.$cookie('U_NAME')
    this.endDate = this.$utils.toDateString(new Date(), 'MM/dd/yyyy HH:mm:ss.SSS')
  }
}
</script>

License

MIT License, 2017-present, Xu Liangzhan

Comments ( 0 )

You need to Sign in for post a comment

Help Search