Skip to content

Commit 2daf66c

Browse files
committed
fix: 组件ts处理
1 parent 197c0ad commit 2daf66c

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/components/align.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!--
22
* @Author: 秦少卫
33
* @Date: 2022-09-03 19:16:55
4-
* @LastEditors: 秦少卫
5-
* @LastEditTime: 2023-07-16 12:15:26
4+
* @LastEditors: June
5+
* @LastEditTime: 2024-04-15 19:52:00
66
* @Description: 组合元素对齐
77
-->
88

@@ -169,7 +169,7 @@
169169
</div>
170170
</template>
171171

172-
<script setup name="Align">
172+
<script name="Align" lang="ts" setup>
173173
import useSelect from '@/hooks/select';
174174
175175
const { mixinState, canvasEditor } = useSelect();

src/hooks/useFont/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ import FontFaceObserver from 'fontfaceobserver';
99
import fontList from '@/assets/fonts/font';
1010
import axios from 'axios';
1111
import { Spin, Message } from 'view-ui-plus';
12-
import { useI18n } from 'vue-i18n';
13-
import { computed, onMounted, ref, unref } from 'vue';
1412

1513
const repoSrc = import.meta.env.APP_REPO;
1614

1715
const _fontList = ref<any[]>([]);
1816

1917
export function useFont() {
20-
const { t } = useI18n();
21-
2218
const initFont = () => {
2319
if (unref(_fontList).length > 0) return;
2420
axios.get(`${repoSrc}/font/free-font.json`).then((res) => {
@@ -36,12 +32,12 @@ export function useFont() {
3632
font
3733
.load(null, 150000)
3834
.then(() => {
39-
Message.success(t('alert.loading_fonts_success'));
35+
Message.success('字体加载成功');
4036
Spin.hide();
4137
resolve(true);
4238
})
4339
.catch(() => {
44-
Message.error(t('alert.loading_fonts_failed'));
40+
Message.error('字体加载失败');
4541
Spin.hide();
4642
resolve(false);
4743
});

0 commit comments

Comments
 (0)