-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1020 from ymmooot/nuxt3-stable
nuxt3 stable
- Loading branch information
Showing
17 changed files
with
1,158 additions
and
1,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { computed } from 'vue'; | ||
import { useHead } from '#head'; | ||
|
||
export default (nuxtApp) => { | ||
const mixin = { | ||
created() { | ||
if (typeof this.$options?.jsonld !== 'function') { | ||
return; | ||
} | ||
const jsonComputed = computed(() => this.$options.jsonld.call(this)); | ||
useHead(() => ({ | ||
script: [ | ||
{ | ||
type: 'application/ld+json', | ||
children: jsonComputed.value ? JSON.stringify(jsonComputed.value, null, '') : undefined, | ||
}, | ||
], | ||
})); | ||
}, | ||
}; | ||
const plugin = { | ||
install(Vue) { | ||
Vue.mixin(mixin); | ||
}, | ||
}; | ||
nuxtApp.vueApp.use(plugin); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,4 @@ | ||
import { computed } from 'vue'; | ||
import { defineNuxtPlugin } from '#app'; | ||
import { useHead } from '#head'; | ||
import plugin from './plugin-impl'; | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
const mixin = { | ||
created() { | ||
if (typeof this.$options?.jsonld !== 'function') { | ||
return; | ||
} | ||
const jsonComputed = computed(() => this.$options.jsonld.call(this)); | ||
useHead(() => ({ | ||
script: [ | ||
{ | ||
type: 'application/ld+json', | ||
children: jsonComputed.value ? JSON.stringify(jsonComputed.value, null, '') : undefined, | ||
}, | ||
], | ||
})); | ||
}, | ||
}; | ||
const plugin = { | ||
install(Vue) { | ||
Vue.mixin(mixin); | ||
}, | ||
}; | ||
nuxtApp.vueApp.use(plugin); | ||
}); | ||
export default defineNuxtPlugin(plugin); |
Oops, something went wrong.