mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
docs: update links to nuxt.com
(#18425)
This commit is contained in:
parent
0236a799f2
commit
2af6cc84db
@ -1,4 +1,4 @@
|
||||
# Nuxt 3 Docs
|
||||
|
||||
- Website: https://v3.nuxtjs.org/
|
||||
- Setup and Contribution Guide: https://v3.nuxtjs.org/community/contribution#documentation-guide
|
||||
- Website: https://nuxt.com/
|
||||
- Setup and Contribution Guide: https://nuxt.com/docs/community/contribution#documentation-guide
|
||||
|
@ -35,7 +35,7 @@ export default defineComponent({
|
||||
```
|
||||
|
||||
```ts [pages/index.tsx]
|
||||
// https://v3.nuxtjs.org/examples/advanced/jsx
|
||||
// https://nuxt.com/docs/examples/advanced/jsx
|
||||
// https://vuejs.org/guide/extras/render-function.html#jsx-tsx
|
||||
export default defineComponent({
|
||||
render () {
|
||||
|
@ -14,7 +14,7 @@ You can use `useNuxtApp()` within composables, plugins and components.
|
||||
|
||||
### `provide (name, value)`
|
||||
|
||||
`nuxtApp` is a runtime context that you can extend using [Nuxt plugins](https://v3.nuxtjs.org/guide/directory-structure/plugins). Use the `provide` function to create Nuxt plugins to make values and helper methods available in your Nuxt application across all composables and components.
|
||||
`nuxtApp` is a runtime context that you can extend using [Nuxt plugins](/docs/guide/directory-structure/plugins). Use the `provide` function to create Nuxt plugins to make values and helper methods available in your Nuxt application across all composables and components.
|
||||
|
||||
`provide` function accepts `name` and `value` parameters.
|
||||
|
||||
@ -69,8 +69,8 @@ await nuxtApp.callHook('my-plugin:init')
|
||||
`vueApp` is the global Vue.js [application instance](https://vuejs.org/api/application.html#application-api) that you can access through `nuxtApp`. Some useful methods:
|
||||
|
||||
- [**component()**](https://vuejs.org/api/application.html#app-component) - Registers a global component if passing both a name string and a component definition, or retrieves an already registered one if only the name is passed.
|
||||
- [**directive()**](https://vuejs.org/api/application.html#app-directive) - Registers a global custom directive if passing both a name string and a directive definition, or retrieves an already registered one if only the name is passed[(example)](https://v3.nuxtjs.org/guide/directory-structure/plugins#vue-directives).
|
||||
- [**use()**](https://vuejs.org/api/application.html#app-use) - Installs a **[Vue.js Plugin](https://vuejs.org/guide/reusability/plugins.html)** [(example)](https://v3.nuxtjs.org/guide/directory-structure/plugins#vue-plugins).
|
||||
- [**directive()**](https://vuejs.org/api/application.html#app-directive) - Registers a global custom directive if passing both a name string and a directive definition, or retrieves an already registered one if only the name is passed[(example)](/docs/guide/directory-structure/plugins#vue-directives).
|
||||
- [**use()**](https://vuejs.org/api/application.html#app-use) - Installs a **[Vue.js Plugin](https://vuejs.org/guide/reusability/plugins.html)** [(example)](/docs/guide/directory-structure/plugins#vue-plugins).
|
||||
|
||||
:ReadMore{link="https://vuejs.org/api/application.html#application-api"}
|
||||
|
||||
|
@ -26,8 +26,8 @@ If you have a `pages/` folder, `useRouter` is identical in behavior to the one p
|
||||
- **back:** Go back in history if possible, same as `router.go(-1)`.
|
||||
- **forward:** Go forward in history if possible, same as `router.go(1)`.
|
||||
- **go:** Move forward or backward through the history without the hierarchical restrictions enforced in `router.back()` and `router.forward()`.
|
||||
- **push:** Programmatically navigate to a new URL by pushing an entry in the history stack. **It is recommended to use [`navigateTo`](http://v3.nuxtjs.org/api/utils/navigate-to) instead.**
|
||||
- **replace:** Programmatically navigate to a new URL by replacing the current entry in the routes history stack. **It is recommended to use [`navigateTo`](http://v3.nuxtjs.org/api/utils/navigate-to) instead.**
|
||||
- **push:** Programmatically navigate to a new URL by pushing an entry in the history stack. **It is recommended to use [`navigateTo`](/docs/api/utils/navigate-to) instead.**
|
||||
- **replace:** Programmatically navigate to a new URL by replacing the current entry in the routes history stack. **It is recommended to use [`navigateTo`](/docs/api/utils/navigate-to) instead.**
|
||||
|
||||
> TIP: `router.addRoute()` adds route details into an array of routes and it is useful while building Nuxt plugins while `router.push()` on the other hand, triggers a new navigation immediately and it is useful in Nuxt Page components, Vue components and composable.
|
||||
|
||||
|
@ -4,7 +4,7 @@ title: "definePageMeta"
|
||||
|
||||
# `definePageMeta`
|
||||
|
||||
`definePageMeta` is a compiler macro that you can use to set metadata for your **page** components located in the `pages/` directory (unless [set otherwise](https://v3.nuxtjs.org/api/configuration/nuxt-config#pages)). This way you can set custom metadata for each static or dynamic route of your Nuxt application.
|
||||
`definePageMeta` is a compiler macro that you can use to set metadata for your **page** components located in the `pages/` directory (unless [set otherwise](/docs/api/configuration/nuxt-config#pages)). This way you can set custom metadata for each static or dynamic route of your Nuxt application.
|
||||
|
||||
```vue [pages/some-page.vue]
|
||||
<script setup>
|
||||
|
@ -110,10 +110,10 @@ export default defineNuxtRouteMiddleware((to, from) => {
|
||||
<script setup>
|
||||
// will throw an error;
|
||||
// navigating to an external URL is not allowed by default
|
||||
await navigateTo('https://v3.nuxtjs.org')
|
||||
await navigateTo('https://nuxt.com')
|
||||
|
||||
// will redirect successfully with the 'external' parameter set to 'true'
|
||||
await navigateTo('https://v3.nuxtjs.org', {
|
||||
await navigateTo('https://nuxt.com', {
|
||||
external: true
|
||||
})
|
||||
</script>
|
||||
|
@ -23,14 +23,14 @@ This page lists the current status and schedule of our planned releases.
|
||||
|
||||
### Current Releases
|
||||
|
||||
[Nuxt 3](https://v3.nuxtjs.org) is *stable** and available as the `nuxt` npm tag with `latest` tag.
|
||||
[Nuxt 3](https://nuxt.com) is *stable** and available as the `nuxt` npm tag with `latest` tag.
|
||||
|
||||
The latest updates on Nuxt 2.x are available via the `nuxt-edge` npm package and are expected to be released soon for forward compatibility. A minor version is expected during Autumn, 2022 as `nuxt@2.16` with cumulative updates for future compatibility with Bridge.
|
||||
|
||||
Release | npm | Status | Last Release | Docs | Repository
|
||||
---------|----|---------|--------------|------|-----------------
|
||||
Nuxt 3.x | [`nuxt`](https://npmjs.com/package/nuxt) | Stable | <a href="https://npmjs.com/package/nuxt"><img src="https://flat.badgen.net/npm/v/nuxt"></a> | [3.x docs](https://nuxt.com/docs/) | [nuxt/nuxt](https://github.com/nuxt/nuxt)
|
||||
Nuxt 3.x (edge*) | [`nuxt3`](https://npmjs.com/package/nuxt3) | Development | <a href="https://npmjs.com/package/nuxt3"><img src="https://flat.badgen.net/npm/v/nuxt3"></a> | [3.x docs](https://v3.nuxtjs.org/) | [nuxt/nuxt](https://github.com/nuxt/nuxt)
|
||||
Nuxt 3.x (edge*) | [`nuxt3`](https://npmjs.com/package/nuxt3) | Development | <a href="https://npmjs.com/package/nuxt3"><img src="https://flat.badgen.net/npm/v/nuxt3"></a> | [3.x docs](https://nuxt.com/) | [nuxt/nuxt](https://github.com/nuxt/nuxt)
|
||||
Nuxt 2.x | [`nuxt`](https://npmjs.com/package/nuxt) | Maintenance | <a href="https://npmjs.com/package/nuxt"><img src="https://flat.badgen.net/npm/v/nuxt/2.15.8"></a> | [2.x docs](https://nuxtjs.org/docs) | [nuxt/nuxt#2.x](https://github.com/nuxt/nuxt/tree/2.x)
|
||||
Nuxt 2.x (edge*) | [`nuxt-edge`](https://npmjs.com/package/nuxt-edge) | Maintenance | <a href="https://npmjs.com/package/nuxt-edge"><img src="https://flat.badgen.net/npm/v/nuxt-edge"></a> | [2.x docs](https://nuxtjs.org/docs) | [nuxt/nuxt](https://github.com/nuxt/nuxt/tree/2.x-dev)
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Nuxt 3 Examples
|
||||
|
||||
👉 https://v3.nuxtjs.org/examples
|
||||
👉 https://nuxt.com/docs/examples
|
||||
|
@ -5,7 +5,7 @@ export const useLocale = () => useState<string>('locale', () => useDefaultLocale
|
||||
export const useDefaultLocale = (fallback = 'en-US') => {
|
||||
const locale = ref(fallback)
|
||||
if (process.server) {
|
||||
// Learn more about the nuxtApp interface on https://v3.nuxtjs.org/docs/usage/nuxt-app#nuxtapp-interface-advanced
|
||||
// Learn more about the nuxtApp interface on https://nuxt.com/docs/guide/going-further/internals#the-nuxtapp-interface
|
||||
const reqLocale = useRequestHeaders()['accept-language']?.split(',')[0]
|
||||
if (reqLocale) {
|
||||
locale.value = reqLocale
|
||||
|
@ -7,7 +7,7 @@ import { isCI } from 'std-env'
|
||||
|
||||
const logger = consola.withTag('crawler')
|
||||
|
||||
const baseURL = withoutTrailingSlash(process.env.BASE_URL || 'https://v3.nuxtjs.org')
|
||||
const baseURL = withoutTrailingSlash(process.env.BASE_URL || 'https://nuxt.com')
|
||||
const startingURL = baseURL + '/'
|
||||
|
||||
const excludedExtensions = ['svg', 'png', 'jpg', 'sketch', 'ico', 'gif']
|
||||
|
Loading…
Reference in New Issue
Block a user