1.4.0 • Published 3 years ago

coa-nuxt v1.4.0

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

coa-nuxt

GitHub license npm version npm downloads PRs Welcome

一个基于 Nuxt 的前端集成框架,包含了 Nuxt 基本框架、常用方法、必要的第三方类库

使用说明

安装

yarn add coa-nuxt

框架

🚧 文档建设中

组件

Gateway 接口网关

🚧 文档建设中

storage 储存

import { storage } from 'coa-nuxt'

// 设置本地储存
storage.local.set('key1', { info: 'value1' }, 10 * 60 * 1000 /*10分钟有效期*/)
// 获取本地储存
storage.local.get('key1')

// 设置会话储存
storage.session.set('key2', { info: 'value2' }, 10 * 60 * 1000 /*10分钟有效期*/)
// 获取会话储存
storage.session.get('key2')

time 时间

time 包含了一些常用时间常量,单位为毫秒

import { time } from 'coa-nuxt'

// 1秒钟 1000
time.oneSecond
// 1分钟 60*1000
time.oneMinute
// 1小时 60*60*1000
time.oneHour
// 1天 24*60*60*1000
time.oneDay
// 1周 7*24*60*60*1000
time.oneWeek
// 1个月 30*24*60*60*1000
time.oneMonth
// 1年 365*24*60*60*1000
time.oneYear
// 1世纪 100*365*24*60*60*1000
time.oneCentury
// 永久(100世纪) 100*100*365*24*60*60*1000
time.forever

echo 输出

import { echo } from 'coa-nuxt'

// 输出一个信息
echo.log('this is message')

// 输出一个信息并报错
echo.error('this is message with error')

die 终止

import { die } from 'coa-nuxt'

// 终止代码运行并给出提示信息
die.hint('error message')

第三方库

包含以下第三方库

// 获取 dayjs 对象,dayjs的使用详见 https://day.js.org/zh-CN
import { dayjs } from 'coa-nuxt'

// 获取 lodash 对象,lodash的使用详见 https://lodash.com
import { lodash } from 'coa-nuxt'

// lodash 存在别名 _ ,也可以直接导入
import { _ } from 'coa-nuxt'
1.4.0

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.33

4 years ago

1.0.34

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago