Add frontend 2.0
This commit is contained in:
28
frontend/src/stores/cover.ts
Normal file
28
frontend/src/stores/cover.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { generateSplitCover } from '@/lib/covergen';
|
||||
|
||||
export const useCover = defineStore('coverSettings', {
|
||||
state() {
|
||||
return {
|
||||
customer: '',
|
||||
prefix: 'offerte',
|
||||
number: '',
|
||||
color: '#ff00ff',
|
||||
|
||||
frontUri: '',
|
||||
backUri: '',
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
render() {
|
||||
const { front, back } = generateSplitCover({
|
||||
customer: this.customer,
|
||||
numberPrefix: this.prefix,
|
||||
number: this.number,
|
||||
hlColor: this.color,
|
||||
});
|
||||
this.frontUri = URL.createObjectURL(front);
|
||||
this.backUri = URL.createObjectURL(back);
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user