salix/print/report/email-header/index.js

23 lines
486 B
JavaScript
Executable File

module.exports = {
name: 'email-header',
asyncData(ctx) {
return {
isPreview: ctx.method === 'GET',
};
},
created() {
const embeded = [];
this.files.map(file => {
const src = this.isPreview ? `/api/${file}` : `cid:${file}`;
embeded[file] = src;
});
this.embeded = embeded;
},
data() {
return {
files: ['/assets/images/email-logo.png'],
};
},
};