oda-framework
Version:
33 lines (31 loc) • 898 B
JavaScript
const PATH = import.meta.url.replace('pdf-viewer.js','');
ODA({ is: 'oda-pdf-viewer', imports: '@oda/button',
template: `
<style>
:host {
--vertical;
--flex;
position: relative;
height: 100%;
}
</style>
<iframe :src style="width: 100%; height: 100%; border: none;"></iframe>
`,
$public: {
nativeView: {
$def: false,
$save: true
},
url: ''
},
get src() {
const n = this.url;
if (this.nativeView)
return n?.startsWith('./') ? PATH + n.replace('./', '') : n;
return PATH + 'web/viewer.html?file=' + (n?.startsWith('./') ? PATH + n.replace('./', '') : n);
},
isReady: false,
attached() {
this.isReady = true;
}
})