Skip to content

Commit 55ec1bf

Browse files
authored
fix: Element-Plus 1.0.2-beta.59(包含59)之后,国际化按需引入有破坏性变动,导致的国际化失效 (#494)
* fix: 修复路由“order”字段 数字 无法重复的bug * fix: 重写Utils.sortByOrder()的实现,解决order负数排序异常的问题 * fix: 修复404页面高度没有正确设置的bug * fix: Element-Plus 1.0.2-beta.59(包含59)之后,国际化按需引入有破坏性变动,导致的国际化失效
1 parent d883d5d commit 55ec1bf

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/app.vue

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
<template>
2-
<div id="app"><router-view /></div>
2+
<el-config-provider :locale="locale">
3+
<div id="app">
4+
<router-view />
5+
</div>
6+
</el-config-provider>
37
</template>
48

59
<script>
10+
import { ElConfigProvider } from 'element-plus'
11+
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
12+
613
export default {
14+
components: {
15+
[ElConfigProvider.name]: ElConfigProvider,
16+
},
17+
data() {
18+
return {
19+
locale: zhCn,
20+
}
21+
},
722
mounted() {
823
document.getElementById('loader').style.display = 'none'
924
},

src/view/error-page/404.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
</template>
77

88
<script type="text/ecmascript-6">
9-
import { onMounted } from 'vue'
9+
import { getCurrentInstance, onMounted } from 'vue'
1010
1111
export default {
12-
setup(props, ctx) {
12+
setup() {
1313
onMounted(() => {
1414
const headerHeight = 72
1515
const { clientHeight } = document.body
16+
17+
const ctx = getCurrentInstance()
1618
ctx.refs.container.style.height = `${clientHeight - headerHeight}px`
1719
})
1820
}

0 commit comments

Comments
 (0)