implement signature preview
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
export default class extends HTMLElement {
|
||||
setValue (value) {
|
||||
this.innerHTML = value
|
||||
const { fieldType } = this.dataset
|
||||
|
||||
if (fieldType === 'signature') {
|
||||
[...this.children].forEach(e => e.remove())
|
||||
|
||||
const img = document.createElement('img')
|
||||
|
||||
img.classList.add('w-full', 'h-full', 'object-contain')
|
||||
img.src = value.url
|
||||
|
||||
this.append(img)
|
||||
} else {
|
||||
this.innerHTML = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user