feat: 创建Photos虚拟组件(设置 virtualComponent 组件路径),预设我的|共享类别
This commit is contained in:
parent
f26e4e478a
commit
2b67bb16f3
src/packages/components/Photos
16
src/packages/components/Photos/My/index.ts
Normal file
16
src/packages/components/Photos/My/index.ts
Normal 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]
|
20
src/packages/components/Photos/Share/index.ts
Normal file
20
src/packages/components/Photos/Share/index.ts
Normal 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
|
9
src/packages/components/Photos/index.d.ts
vendored
Normal file
9
src/packages/components/Photos/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export enum ChatCategoryEnum {
|
||||||
|
MY = 'My',
|
||||||
|
SHARE = 'Share'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ChatCategoryEnumName {
|
||||||
|
MY = '我的',
|
||||||
|
SHARE = '共享'
|
||||||
|
}
|
4
src/packages/components/Photos/index.ts
Normal file
4
src/packages/components/Photos/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import My from './My'
|
||||||
|
import Share from './Share'
|
||||||
|
|
||||||
|
export const PhotoList = [...Share, ...My]
|
Loading…
x
Reference in New Issue
Block a user