代码拉取完成,页面将自动刷新
npm install vuetom --save
Available Plugins: request, date
const { createVuetom, isVuetom } = require('vuetom')
const vt = createVuetom()
use date plugin
const date = require('vuetom/plugin/date')
vt.use(date)
console.log(vt.date(new Date(), 'YYYY-MM-DD HH:mm:ss')) // 2022-xx-xx xx:xx:xx
console.log(vt.getDate()) // get date object
use http request plugin
Function has:
const request = require('vuetom/plugin/request')
vt.use(request)
vt.http('https://api.github.com/users/yyx990803', {
method: 'get'
}, (err, resp, body) => {
console.log('err', err)
console.log('body', body)
})
Available Plugins: date
import { createVuetom } from 'vuetom'
import date from 'vuetom/plugin/date'
// The usage is the same as nodejs
// ...
Available Plugins: date
<script src="../vuetom/dist/vuetom.js"></script>
<script src="../vuetom/dist/plugin/date.js"></script>
<script src="../vuetom/dist/plugin/storage.js"></script>
<script>
var vt = vuetom.createVuetom()
var vt_date = window.vt_plugin_date
var vt_storage = window.vt_plugin_storage
vt.use(vt_date)
console.log(vt.date(new Date, 'YY MM DD'))
vt.use(vt_storage)
vt.storage.set('key1', 'val1')
console.log(vt.storage.get('key1')) // val1
</script>
[Common]
[Node]
[Browser]
pnpm install
packages/vuetom
cd packages/vuetom
# build dist
pnpm b
# build modules
pnpm b:esm
# build browser node
pnpm b:umd
packages/test
cd packages/test
# node test
pnpm test-n
# es test
pnpm test-es
# web test
# preview.html
Vuetom.js is licensed under a MIT License.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。