This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Class to manage asset data model **/ | |
export default class Asset { | |
constructor (rawData = {}) { | |
Vue.set(this, 'data', rawData) | |
} | |
get slot () { | |
return name => { | |
for (const slot of this.data.slots) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** VUEX module for image asset management **/ | |
import Vue from 'vue' | |
import Asset from './assetClass.js' | |
export default { | |
namespaced: true, | |
// ----------------------------------------------------------------- | |
state: { | |
asset: new Asset() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const asset = this.$store.getters['asset/asset'] | |
const originalSlot = asset.slot('original') | |
originalSlot.public_url = 'some new url' | |
asset.setSlot(originalSlot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Store module to handle movies lists **/ | |
import Vue from 'vue' | |
export default { | |
namespaced: true, | |
// ---------------------------------------------------------------------------------- | |
state: { | |
movies: [] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Store module to handle TMDb config **/ | |
import Vue from 'vue' | |
export default { | |
namespaced: true, | |
// ---------------------------------------------------------------------------------- | |
state: { | |
images: {} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="movie"> | |
<h5>{{movie.title}}</h5> | |
<img :src="posterUrl"> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'MovieCard', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Store module to handle movies lists **/ | |
import Vue from 'vue' | |
export default { | |
namespaced: true, | |
// ---------------------------------------------------------------------------------- | |
state: { | |
movies: [] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="movie"> | |
<h5>{{movie.title}}</h5> | |
<img :src="$store.getters['movies/posterUrl'](movie.id)" onerror="this.src=''"> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'MovieCard', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Model definition file for the Movie Class **/ | |
import store from '../store' | |
export default class Movie { | |
constructor (rawData = {}) { | |
this.id = rawData.id | |
this.title = rawData.title | |
this.poster_path = rawData.poster_path | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Store module to handle movies lists **/ | |
import Vue from 'vue' | |
import Movie from '../models/MovieClass' | |
export default { | |
namespaced: true, | |
// ---------------------------------------------------------------------------------- | |
state: { | |
movies: [] |