大佬教程收集整理的这篇文章主要介绍了如何在inertiajs和vue3中设置和更改(页面标题),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我将 vue3 和 inertiaJs 与 Laravel8
一起使用如果我更改页面,我想更改(页面标题)
我在 Inertia 文档中查看了这段代码,但它对我不起作用,页面标题也没有改变 我安装了 vue-Meta
MetaInfo() {
return() {
title: “Home Page”,}
}
return()
是一个属性,而不是一个函数。 :) 所以你应该这样做:return
// parent
metaInfo: {
meta: [{
vmid: 'description',name: 'description',content: 'my standard description',}]
}
// child
metaInfo() {
return {
meta: [{
vmid: 'description',content: this.description,}]
}
},
请访问 this Vue doc
了解更多信息 ,根据 Inertia 的 v0.4.0,他们现在捆绑了自己的 inertia-head
组件,您可以使用它来添加元标记和更新标题。不再需要 vue-meta
。
只需将以下内容直接添加到您的页面组件中:
<inertia-head>
<title>Your page title</title>
<meta name="description" content="Your page description">
</inertia-head>
您可以在 change logs of v0.4.0 中找到更多信息。
以上是大佬教程为你收集整理的如何在inertiajs和vue3中设置和更改(页面标题)全部内容,希望文章能够帮你解决如何在inertiajs和vue3中设置和更改(页面标题)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。