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

16 lines
310 B
JavaScript
Raw Normal View History

2019-10-29 06:46:44 +00:00
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);