orchard/resources/cider-ui-tests/views/components/mediaitem-artwork.ejs
2021-12-07 21:04:03 +07:00

32 lines
No EOL
1 KiB
Text

<script type="text/x-template" id="mediaitem-artwork">
<template v-if="type == 'artists'">
<div class="mediaitem-artwork rounded">
<img :src="app.getMediaItemArtwork(url, size)"
class="mediaitem-artwork--img">
</div>
</template>
<template v-else>
<div class="mediaitem-artwork">
<img :src="app.getMediaItemArtwork(url, size)"
class="mediaitem-artwork--img">
<div v-if="video" class="animatedartwork-view-box">
<animatedartwork-view :video="video"></animatedartwork-view>
</div>
</div>
</template>
</script>
<script>
Vue.component('mediaitem-artwork', {
template: '#mediaitem-artwork',
props: ['size', 'url', 'type', 'video'],
methods: {
getArtworkStyle() {
return {
width: this.size + 'px',
height: this.size + 'px'
};
}
}
});
</script>