salix/print/core/mixins/image-src.js

16 lines
310 B
JavaScript

const Vue = require('vue');
const imageSrc = {
methods: {
getSrc(image) {
let src = `cid:${image}`;
if (this.isPreview === 'true')
src = `/api/assets/${this.$options.name}/images/${image}`;
return src;
}
},
};
Vue.mixin(imageSrc);