Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for definePageMeta #933

Merged
merged 4 commits into from Oct 19, 2023
Merged

feat: add support for definePageMeta #933

merged 4 commits into from Oct 19, 2023

Conversation

wattanx
Copy link
Collaborator

@wattanx wattanx commented Oct 15, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add a module so that definePageMeta can also be used in Nuxt 2.
It is difficult to support other properties, so only layout and middleware will be supported first.

I have converted it as follows.

webpack

const __nuxt_page_meta = {
  layout: 'test'
}
export default /*#__PURE__*/_defineComponent({
  ...__nuxt_page_meta,
  __name: 'redirect',
  setup: function setup(__props) {
    return {
      __sfc: true
    };
  }
});

vite

const __nuxt_page_meta = {
  layout: "test"
}
const _sfc_main = /* @__PURE__ */ _defineComponent({
  ...__nuxt_page_meta,
  __name: "redirect",
  setup(__props) {
    return { __sfc: true };
  }
});

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@wattanx wattanx changed the title feat: add page-meta module feat: add definePageMeta Oct 19, 2023
@wattanx wattanx marked this pull request as ready for review October 19, 2023 14:26
@danielroe danielroe changed the title feat: add definePageMeta feat: add support for definePageMeta Oct 19, 2023
@danielroe danielroe merged commit 913b8e5 into main Oct 19, 2023
9 checks passed
@danielroe danielroe deleted the feat/page-meta-module branch October 19, 2023 23:00
@danielroe
Copy link
Member

This is very nice πŸ‘Œ

@vitaly-petras
Copy link

perfect! Maybe you should also update documentation here: https://nuxt.com/docs/bridge/plugins-and-middleware (very bottom). Because its not working without macros.pageMeta enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants