1.1.3 • Published 5 years ago

@fuzzco/super-image v1.1.3

Weekly downloads
5
License
MIT
Repository
-
Last release
5 years ago

All-in-one image component for Vue. Demo

npm i @fuzzco/super-image

Register component in Vue, then:

<template>
    <main>
        <!-- place a square image in a 16:9 aspect ratio -->
        <super-image src="//placehold.it/300x300" aspect="56.25" />

        <!-- use raw HTML for contents -->
        <super-image :html="imgHtml" />
    </main>
</template>

<script>
    export default {
        data() {
            return {
                imgHtml: '<img src="//placehold.it/300x300">'
            }
        }
    }
</script>

Options

PropTypeDefaultNotes
altStringnone
aspectString, NumbernoneManually-defined aspect ratio of image. Overrides aspect ratio calculated by width and height props.
colorStringtransparent
fill-spaceBooleanfalse
fitStringcovercover or contain.
heightString, NumbernoneManually-defined height of image in px.
htmlStringnoneRaw HTML to drop into super-image wrapper.
loopBooleantrue
no-image-after-canvasBooleanfalseOnly applies if use-canvas is true. Prevents placement of image after canvas. Generally best to leave false, since placing the image after the canvas should increase accessibility and make for better SEO.
posterString, Booleannone
respect-maxBooleanfalse
srcStringnoneSource URL.
use-canvasBooleanfalseWhether or not to render the image with a canvas instead of an img element. Allows for easier image manipulation. Currently does not support video or fit properties. Places an opacity: 0; pointer-events: none; img element above the canvas unless no-image-after-canvas set to true.
video-srcString, Booleannone
width }String, NumbernoneManually-defined width of image in px.

Events

NameParametersNotes
ended(event: video event)Event emitted by video (if provided) upon ending.
1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago