vue-facing-decorator
vue-facing-decorator copied to clipboard
Include example with definePageMeta for layout
I just spent much more that I wish anybody should have, just to realize that there are too many ways to write code with definePageMeta
, but only single one works with vue-facing-decorator
.
// <script lang="ts">
@Component({})
class PdfPageExample extends Vue {
@Setup(() => definePageMeta({ layout: 'print-pdf' })) private _layout!: never;
// ...
- It cannot go to a separate
<script>
- It cannot be just a plain call to
definePageMeta
above component declaration - The field name has to start with underline (
private
andnever
are not relevant)
Layouts are quite common feature in Vue and I wonder if I just missed something in Docs or is it in fact missing.
Edit... well, it worked for a while, but restarting Dev server get's stuck again. The error is the source of my frustration as it is hardly pointing to anything specific.
ERROR [unhandledRejection] Unexpected character '@' (5:0)
at pp$4.raise (node_modules/acorn/dist/acorn.mjs:3580:13)
at pp.getTokenFromCode (node_modules/acorn/dist/acorn.mjs:5561:8)
at ...