Skip to content

Latest commit

History

History
53 lines (38 loc) 路 1.14 KB

+Page.mdx

File metadata and controls

53 lines (38 loc) 路 1.14 KB

import { Link, Warning } from '@brillout/docpress'

To install Vike extensions you use extends:

// /pages/+config.js

import vikeReact from 'vike-react/config'

export default {
  // Install vike-react.
  // In technical terms: inherit the configuration set by `vike-react/config`.
  extends: vikeReact
}

Inheritance

Note that config inheritance also applies to extends.

For example, you can use two completely different rendering strategy: some pages can use Vue without SSR while other pages can use React with SSR.

// /pages/admin/+config.js

import vikeVue from 'vike-vue/config'

// Applies only to Admin Panel pages:
//   /pages/admin/income/+Page.js
//   /pages/admin/kpi/+Page.js
//   ...

// Make all Admin Panel pages use Vue without SSR:
export default {
  ssr: false,
  extends: [vikeVue]
}
// /pages/product/@id/+config.js

import vikeReact from 'vike-react/config'

// Applies only to the product page:
//   /pages/product/@id/+Page.js

// Make the product page use React with SSR:
export default {
  ssr: true,
  extends: [vikeReact]
}