回到 Canner

多張圖片

Basic

Basic Gallery.

Return value:
[
  {
    "title": "image 1",
    "image": "http://i.imgur.com/56XquqC.png"
  },
  {
    "title": "image 2",
    "image": "https://s3-ap-northeast-1.amazonaws.com/cans.canner.io/photo/0.0.1/agency/shop2.jpg"
  }
]

1
CannerTypes.array().ui('gallery').description('');

Change key

Change key by uiParams.

Return value:
[
  {
    "name": "image 1",
    "src": "http://i.imgur.com/56XquqC.png",
    "thumbnail": "http://i.imgur.com/56XquqC.png"
  },
  {
    "name": "image 2",
    "src": "https://s3-ap-northeast-1.amazonaws.com/cans.canner.io/photo/0.0.1/agency/shop2.jpg",
    "thumbnail": "https://s3-ap-northeast-1.amazonaws.com/cans.canner.io/photo/0.0.1/agency/shop2.jpg"
  }
]

1
2
3
4
5
6
CannerTypes.array().ui('gallery').description('')
  .uiParams({
    titleKey: "title",
    imageKey: "src",
    thumbKey: "thumbnail"
  });