fix: 修改语言挂载问题

This commit is contained in:
mtruning
2022-01-09 19:22:55 +08:00
parent 7332dd1e98
commit 39ab04e051
16 changed files with 96 additions and 99 deletions
@@ -24,4 +24,5 @@ import {
import { MessageContent } from '@/components/MessageContent'
import { DialogContent } from '@/components/DialogContent'
import { LoadingContent } from '@/components/LoadingContent'
</script>
+3
View File
@@ -0,0 +1,3 @@
import AppProvider from './AppProvider.vue';
export { AppProvider };
+23 -18
View File
@@ -53,23 +53,28 @@ const filterBtnList = computed(() => {
const isFull = computed(() => {
return props.narrow && screenfullFn(true)
})
const btnList = [
{
title: '关闭',
key: 'close',
icon: CloseIcon
},
{
title: '缩小',
key: 'remove',
icon: RemoveIcon
},
{
title: isFull ? '缩小' : '放大',
key: props.narrow ? 'fullResize' : 'resize',
icon: ResizeIcon
}
]
const btnList: {
title: string,
key: "close" | "remove" | "resize" | "fullResize",
icon: any
}[] = [
{
title: '关闭',
key: 'close',
icon: CloseIcon
},
{
title: '缩小',
key: 'remove',
icon: RemoveIcon
},
{
title: isFull ? '缩小' : '放大',
key: props.narrow ? 'fullResize' : 'resize',
icon: ResizeIcon
}
]
const handleClick = (key: 'close' | 'remove' | 'resize' | 'fullResize') => {
if (key === 'fullResize') screenfullFn()
@@ -80,7 +85,7 @@ const handleClick = (key: 'close' | 'remove' | 'resize' | 'fullResize') => {
</script>
<style lang="scss" scoped>
@include go('apple-control-btn') {
@include go("apple-control-btn") {
display: flex;
&:hover {
.btn {
-3
View File
@@ -1,3 +0,0 @@
import AppProvider from './Application.vue';
export { AppProvider };
+4 -10
View File
@@ -1,12 +1,6 @@
<template></template>
<script lang="ts">
import { useDialog } from 'naive-ui';
export default {
name: 'DialogContent',
setup() {
//挂载在 window 方便与在js中使用
window['$dialog'] = useDialog();
},
};
<script lang="ts" setup>
import { useDialog } from 'naive-ui';
//挂载在 window 方便与在js中使用
window['$dialog'] = useDialog();
</script>
+3
View File
@@ -0,0 +1,3 @@
import I18n from './index.vue';
export { I18n };
+7
View File
@@ -0,0 +1,7 @@
<template></template>
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
window['$t'] = t
</script>
+6 -10
View File
@@ -1,12 +1,8 @@
<script lang="ts">
import { useLoadingBar } from 'naive-ui'
<template></template>
export default {
name: 'LoadingContent',
setup() {
// 挂载在 window 方便与在js中使用
window['$loading'] = useLoadingBar()
window['$loading'].finish()
}
}
<script lang="ts" setup>
import { useLoadingBar } from 'naive-ui'
// 挂载在 window 方便与在js中使用
window['$loading'] = useLoadingBar()
window['$loading'].finish()
</script>
+5 -9
View File
@@ -1,11 +1,7 @@
<script lang="ts">
import { useMessage } from 'naive-ui';
<template></template>
export default {
name: 'MessageContent',
setup() {
//挂载在 window 方便与在js中使用
window['$message'] = useMessage();
},
};
<script lang="ts" setup>
import { useMessage } from 'naive-ui';
//挂载在 window 方便与在js中使用
window['$message'] = useMessage();
</script>