feat: 创建Photos虚拟组件(设置 virtualComponent 组件路径),预设我的|共享类别

This commit is contained in:
tnt group 2023-05-17 20:16:36 +08:00
parent 3a6990f124
commit c7b2daa0b8
4 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import { PackagesCategoryEnum } from '@/packages/index.d'
import { ImageConfig } from '@/packages/components/Informations/Mores/Image/index'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../index.d'
const photoConfig = {
...ImageConfig,
category: ChatCategoryEnum.MY,
categoryName: ChatCategoryEnumName.MY,
package: PackagesCategoryEnum.PHOTOS,
title: '20052Q04040923.png',
image: 'https://img.phb123.com/uploads/allimg/200528/47-20052Q04040923.png',
dataset: 'https://img.phb123.com/uploads/allimg/200528/47-20052Q04040923.png',
virtualComponent: './components/Informations/Mores/Image' // 虚拟组件路径,尾部不跟 /’,相对于 /packages/index.ts 文件的位置
}
export default [photoConfig, photoConfig, photoConfig, photoConfig, photoConfig]

View File

@ -0,0 +1,20 @@
import { PackagesCategoryEnum } from '@/packages/index.d'
import { ImageConfig } from '@/packages/components/Informations/Mores/Image/index'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../index.d'
const imageList = [
{ imageName: 'carousel1', imageUrl: 'https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel1.jpeg' },
{ imageName: 'carousel2', imageUrl: 'https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel2.jpeg' }
]
const photoConfigList = imageList.map(i => ({
...ImageConfig,
category: ChatCategoryEnum.SHARE,
categoryName: ChatCategoryEnumName.SHARE,
package: PackagesCategoryEnum.PHOTOS,
image: i.imageUrl,
dataset: i.imageUrl,
title: i.imageName,
virtualComponent: './components/Informations/Mores/Image' // 虚拟组件路径,尾部不跟 /’,相对于 /packages/index.ts 文件的位置
}))
export default photoConfigList

View File

@ -0,0 +1,9 @@
export enum ChatCategoryEnum {
MY = 'My',
SHARE = 'Share'
}
export enum ChatCategoryEnumName {
MY = '我的',
SHARE = '共享'
}

View File

@ -0,0 +1,4 @@
import My from './My'
import Share from './Share'
export const PhotoList = [...Share, ...My]