代码提交--

This commit is contained in:
luoshiwen 2023-12-14 17:56:04 +08:00
parent 03056ed10a
commit 94b1415aff
21 changed files with 20 additions and 5 deletions

BIN
src/assets/font/msyhl.ttc Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,5 +0,0 @@
const getImageUrl = (name)=>{
return `url(${new URL(name, import.meta.url).href})`
}
export default getImageUrl

20
src/utils/getPath.js Normal file
View File

@ -0,0 +1,20 @@
// 将所有图片导入进来
const req1 = import.meta.glob("../assets/images/**", {eager: true});
const req = {...req1};
const imagesMap = {};
// 循环所有图片,将图片名设置成键,值为导入该图片的地址
for (const key in req) {
// let name = key.replace(/(\.\/images\/|\..*)/g, '')
let name = key.split("/").slice(-1)[0].split(".")[0].replace(/-/g, "");
// 抛出图片大对象后,文件页面直接引入后将图片的具体名称作为属性就能导入该图片
imagesMap[name] = req[key].default;
}
export default imagesMap