|
3 | 3 | <img v-else :src="getSsrSrc()" /> |
4 | 4 | </template> |
5 | 5 |
|
6 | | -<script setup lang="ts"> |
| 6 | +<script lang="ts"> |
| 7 | +/** |
| 8 | + * @mixin VueSDK |
| 9 | + * @description The Cloudinary Vue SDK contains components like \<AdvancedImage\> to easily render your media assets from Cloudinary. |
| 10 | + * The SDK also comes with support for optional JS plugins that make the components smart, with features like lazy loading, placeholder, accessibility & responsiveness. |
| 11 | + * |
| 12 | + * @example |
| 13 | + * <caption> |
| 14 | + * Please note that the order of the plugins is important. See {@link https://cloudinary.com/documentation/sdks/js/frontend-frameworks/index.html#plugin-order|Plugin Order} for more details. |
| 15 | + * </caption> |
| 16 | + * // AdvancedImage |
| 17 | + * <template> |
| 18 | + * <div> |
| 19 | + * <AdvancedImage :cldImg="cldImg" :plugins="plugins" /> |
| 20 | + * </div> |
| 21 | + * </template> |
| 22 | + * |
| 23 | + * <script lang="ts"> |
| 24 | + * import { defineComponent } from 'vue'; |
| 25 | + * import { CloudinaryImage } from '@cloudinary/url-gen/assets/CloudinaryImage'; |
| 26 | + * import { AdvancedImage, responsive } from '@cloudinary/vue'; |
| 27 | + * |
| 28 | + * export default defineComponent({ |
| 29 | + * name: 'App', |
| 30 | + * components: { |
| 31 | + * AdvancedImage, |
| 32 | + * }, |
| 33 | + * setup(props) { |
| 34 | + * const cldImg = new CloudinaryImage( |
| 35 | + * 'sample', |
| 36 | + * { cloudName: 'demo' }, |
| 37 | + * { analytics: false } |
| 38 | + * ); |
| 39 | + * |
| 40 | + * const plugins = [responsive({ steps: 100 })]; |
| 41 | + * |
| 42 | + * return { |
| 43 | + * cldImg, |
| 44 | + * plugins, |
| 45 | + * }; |
| 46 | + * }, |
| 47 | + * }); |
| 48 | + * </ script> |
| 49 | + * |
| 50 | + * @example |
| 51 | + * <caption> |
| 52 | + * Using `AdvancedVideo` custom defined resources. |
| 53 | + * </caption> |
| 54 | + * |
| 55 | + * // AdvancedVideo |
| 56 | + * <template> |
| 57 | + * <AdvancedVideo :cldVid="cldVid" :sources="sources" controls width="600" /> |
| 58 | + * </template> |
| 59 | + * |
| 60 | + * <script lang="ts"> |
| 61 | + * import { defineComponent } from "vue"; |
| 62 | + * import { auto } from "@cloudinary/url-gen/qualifiers/videoCodec"; |
| 63 | + * import { videoCodec } from "@cloudinary/url-gen/actions/transcode"; |
| 64 | + * import { AdvancedVideo } from "../dist"; |
| 65 | + * import { CloudinaryVideo } from "@cloudinary/url-gen/assets/CloudinaryVideo"; |
| 66 | + * |
| 67 | + * export default defineComponent({ |
| 68 | + * name: "App", |
| 69 | + * components: { |
| 70 | + * AdvancedVideo, |
| 71 | + * }, |
| 72 | + * setup(props) { |
| 73 | + * const cldVid = new CloudinaryVideo( |
| 74 | + * "dog", |
| 75 | + * { cloudName: "demo" }, |
| 76 | + * { analytics: false } |
| 77 | + * ); |
| 78 | + * |
| 79 | + * const sources = [ |
| 80 | + * { |
| 81 | + * type: "mp4", |
| 82 | + * transcode: videoCodec(auto()), |
| 83 | + * }, |
| 84 | + * { |
| 85 | + * type: "webm", |
| 86 | + * transcode: videoCodec(auto()), |
| 87 | + * }, |
| 88 | + * ]; |
| 89 | + * |
| 90 | + * return { |
| 91 | + * cldVid, |
| 92 | + * sources, |
| 93 | + * }; |
| 94 | + * }, |
| 95 | + * }); |
| 96 | + * </ script> |
| 97 | + */ |
| 98 | +
|
7 | 99 | /** |
8 | | - * @memberOf CloudinaryVueSDK |
9 | | - * @type {Component} |
| 100 | + * @memberOf VueSDK |
| 101 | + * @module AdvancedImage |
10 | 102 | * @description The Cloudinary image component. |
11 | | - * @prop {CloudinaryImage} cldImg Generated by @cloudinary/url-gen |
12 | | - * @prop {Plugins} plugins Advanced image component plugins accessibility(), responsive(), lazyload(), placeholder() |
| 103 | + * @vue-prop {CloudinaryImage} cldImg Generated by @cloudinary/url-gen |
| 104 | + * @vue-prop {Plugins} plugins Advanced image component plugins accessibility(), responsive(), lazyload(), placeholder() |
13 | 105 | */ |
| 106 | +</script> |
14 | 107 |
|
| 108 | +<script setup lang="ts"> |
15 | 109 | import { ref, onMounted, onUpdated, onUnmounted } from "vue"; |
16 | 110 | import { CloudinaryImage } from "@cloudinary/url-gen/assets/CloudinaryImage"; |
17 | 111 | import { |
|
0 commit comments