facing-dev/vue-facing-decorator

definePageMeta not work

Closed this issue · 4 comments

Not work nexpected character '@'

import { Component, Vue, Setup } from 'vue-facing-decorator'

@Component
export default class MyComponent extends Vue {
  @Setup(() => definePageMeta({
      layout: 'admin',
    }))
    layout!: never
}

Work

@Setup(() => ref({
    layout: 'admin',
  }))
  layout!: never

ref return value but definePageMeta not

and plainData[key] = proxyRefs(setupState); is plainData[key] = proxyRefs(undefined);

if i skip that call on undefined it also not change layout

definePageMeta try to process with ancorn ts code. Vue composables don't do so.

Need to tweak nuxt to use ts plugin for acron
nuxt/nuxt#29790 (comment)

and that library to not make undefined waht is returned by definePageMeta (not all composables return value) reactive, for vue-class-component for example

// vue-class-esm-bundler.js

plainData[key] = setupState ? proxyRefs(setupState) : ref(null); // or something else or not add that to plainData at all!?