const Vue = require('vue'); const config = require('../config'); const imageSrc = { methods: { getEmailSrc(image) { let src = `cid:${image}`; if (this.isPreview === 'true') src = `/api/assets/${this.$options.name}/images/${image}`; return src; }, getReportSrc(image) { const assetsPath = `${config.app.host}/api/assets`; const imagePath = `${assetsPath}/${this.$options.name}/images/${image}`; console.log(imagePath); return imagePath; } }, }; Vue.mixin(imageSrc);