Skip to content

Commit

Permalink
Merge pull request #27 from FEMessage/dev
Browse files Browse the repository at this point in the history
release
  • Loading branch information
levy9527 authored Jul 5, 2019
2 parents 4160af6 + 6d0b986 commit 23564fd
Show file tree
Hide file tree
Showing 8 changed files with 1,386 additions and 53 deletions.
24 changes: 7 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ create-nuxt-app -h

<details><summary>Preview</summary>

![preview](https://i.loli.net/2019/06/14/5d034feaed62768051.gif)
![preview](https://i.loli.net/2019/06/24/5d108d92206de47421.gif)
</details>


Expand All @@ -51,33 +51,23 @@ create-nuxt-app -h
create-nuxt-app -t single
```

![nuxt-element-dashboard](https://i.screenshot.net/4pj3xie)
![nuxt-element-dashboard](https://i.loli.net/2019/06/24/5d108e301184d60426.png)

```bash
create-nuxt-app -t multiple
```

![nuxt-multiple-spa](https://i.screenshot.net/xovynhr)

[⬆ Back to Top](#table-of-contents)

## Feature

1. Http requrest:
- [Axios](https://github.com/nuxt-community/axios-module)

2. UI framework:
- [Element UI](https://femessage.github.io/element/#/zh-CN/component/quickstart)

3. Test framework:
- [Jest](https://github.com/facebook/jest)
![nuxt-multiple-spa](https://i.loli.net/2019/06/24/5d108e300bc8e21918.png)

this is a pratice of micro-frontends

[⬆ Back to Top](#table-of-contents)


## Reference

[create-nuxt-app](https://github.com/nuxt/create-nuxt-app)
- [create-nuxt-app](https://github.com/nuxt/create-nuxt-app)
- [nuxt-element-dashboard](https://github.com/levy9527/nuxt-element-dashboard)

[⬆ Back to Top](#table-of-contents)

Expand Down
2 changes: 1 addition & 1 deletion template/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"release": "gren release --override"
},
"dependencies": {
"@femessage/el-form-renderer": "^1.3.0",
"@femessage/el-form-renderer": "^1.6.0",
"@femessage/theme-deepexi": "^2.4.11",
"@nuxtjs/axios": "^5.0.1",
"@nuxtjs/dotenv": "^1.3.0",
Expand Down
4 changes: 2 additions & 2 deletions template/frameworks/constant/const/filter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dayjs from 'dayjs'

export function formatDate(time, format) {
if (!time) {
export function formatDate(time, format = 'YYYY-MM-DD') {
if (!time && time !== 0) {
return ''
}
return dayjs(time).format(format)
Expand Down
16 changes: 15 additions & 1 deletion template/frameworks/jest/test/formatDate.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import {formatDate} from '@/const/filter.js'

const date = 0

describe('formatDate', () => {
test('no params', () => {
expect(formatDate()).toBeFalsy()
expect(formatDate()).toBe('')
})

test('default formatter: YYYY-MM-DD', () => {
expect(formatDate(date)).toBe('1970-01-01')
})

test('formatter: YYYY/MM/DD', () => {
expect(formatDate(date, 'YYYY/MM/DD')).toBe('1970/01/01')
})

test('formatter: YYYY,MM,DD', () => {
expect(formatDate(date, 'YYYY,MM,DD')).toBe('1970,01,01')
})
})
3 changes: 1 addition & 2 deletions template/frameworks/single/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export const mutations = {
path: cookiePath
})
})
// 清空state,跳转到login页的逻辑交给路由守卫
location.reload()
this.$router.replace('/login')
},

update(state, payload) {
Expand Down
Loading

0 comments on commit 23564fd

Please sign in to comment.