vue-storefront
Version:
A Vue.js, PWA eCommerce frontend
16 lines (14 loc) • 452 B
JavaScript
import config from 'config'
export const thumbnail = {
methods: {
/**
* Return thumbnail url for specific base url
* @param {String} relativeUrl
* @param {Int} width
* @param {Int} height
*/
getThumbnail (relativeUrl, width, height) {
return relativeUrl ? `${config.images.baseUrl}${parseInt(width)}/${parseInt(height)}/resize${relativeUrl}` : config.images.productPlaceholder || ''
}
}
}