add image teaser component (to fix url problems)
This commit is contained in:
parent
681c8375d5
commit
d69b0cef19
1 changed files with 18 additions and 6 deletions
|
|
@ -29,7 +29,7 @@ const Upload = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const GameTeaser = {
|
const GameTeaser = {
|
||||||
name: 'gameteaser',
|
name: 'game-teaser',
|
||||||
props: {
|
props: {
|
||||||
game: Object,
|
game: Object,
|
||||||
},
|
},
|
||||||
|
|
@ -57,10 +57,26 @@ const GameTeaser = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImageTeaser = {
|
||||||
|
name: 'image-teaser',
|
||||||
|
props: {
|
||||||
|
image: Object
|
||||||
|
},
|
||||||
|
template: `<div class="imageteaser" :style="style"></div>`,
|
||||||
|
computed: {
|
||||||
|
style() {
|
||||||
|
return {
|
||||||
|
'background-image': `url("${this.image.url}")`,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Upload,
|
Upload,
|
||||||
GameTeaser,
|
GameTeaser,
|
||||||
|
ImageTeaser,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
gamesRunning: Array,
|
gamesRunning: Array,
|
||||||
|
|
@ -95,11 +111,7 @@ export default {
|
||||||
|
|
||||||
<h1>Image lib</h1>
|
<h1>Image lib</h1>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<image-teaser v-for="i in images" :image="i" @click="image = i" />
|
||||||
v-for="i in images"
|
|
||||||
@click="image = i"
|
|
||||||
class="imageteaser"
|
|
||||||
:style="{'background-image': 'url(' + i.url + ')'}"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1>Finished games</h1>
|
<h1>Finished games</h1>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue