当前位置: 首页 > news >正文

时时彩网站制作网站流量查询平台

时时彩网站制作,网站流量查询平台,wordpress加跳转,拼车网站开发Nuxtjs 最新版 Nuxt3 项目配置 安装nuxtjs 最新版 Nuxt3 参考官网安装安装插件安装ElementPlus页面怎么跳转,路由怎么实现404页面该怎么配置配置 网页的title 安装nuxtjs 最新版 Nuxt3 参考官网安装 安装插件 安装ElementPlus 安装 Element Plus 和图标库 # 首先&…

Nuxtjs 最新版 Nuxt3 项目配置

  • 安装nuxtjs 最新版 Nuxt3 参考官网安装
  • 安装插件
    • 安装ElementPlus
    • 页面怎么跳转,路由怎么实现
    • 404页面该怎么配置
    • 配置 网页的title

安装nuxtjs 最新版 Nuxt3 参考官网安装

安装插件

安装ElementPlus

  1. 安装 Element Plus 和图标库

    # 首先,使用以下命令安装 Element Plus 和它的图标库:pnpm install element-plus pnpm install @element-plus/icons-vue
    
  2. 安装 Nuxt Element Plus 模块

    	pnpm i @element-plus/nuxt -D
    
  3. 配置 Nuxt 项目

     在 nuxt.config.ts 文件中进行配置,添加 Element Plus 模块和 CSS 样式:
    
    	import { defineNuxtConfig } from 'nuxt3'export default defineNuxtConfig({devtools: { enabled: true },modules: ['@element-plus/nuxt']})
    

页面怎么跳转,路由怎么实现

Nuxt.js 依据 pages 目录结构自动生成 vue-router 模块的路由配置。
这是官方原话,也就是说,你不用像传统的vue项目那样,创建router.js 这个文件了。相反,需要注意根目录下这个pages的文件结构。因为Nuxt是根据pages的目录结构自动生成路由文件的。

注意, pages 需要放在项目根目录!!!

在这里插入图片描述

  1. app.vue 这个文件里可以简单放一个 <NuxtPage> 标签,这个标签是nuxt3内置的标签,相当于vue3中的router-view,就是通过路由去渲染的组件内容。

    <template><div><NuxtPage></NuxtPage></div>
    </template>
  2. 路由传值
    文件名格式按照约定写就可,detail-[参数].vue
    接受的话,在该页面中通过以下代码获取:

    <template><div>artical{{  $route.params.id  }}</div>
    </template>	
    
  3. 路由验证

    • 通过在页面(page)中的definePageMeta中的validate属性来实现路由验证。
    • validate属性以route为参数。返回的boolean值就决定了当前路由是否会在此页面中渲染显示。
    • 如果你返回false,并且也没有其它路由匹配规则与之相匹配的话,就会导致404的错误。
    • 你也可以直接返回一个包含了statusCode/statusMessage的对象,来立即返回一个错误(这种情况下,其它路由匹配规则就不会判断了) 。

    原文:
    The validate property accepts the route as an argument. You can return a boolean value to determine whether or not this is a valid route to be rendered with this page. If you return false, and another match can’t be found, this will cause a 404 error. You can also directly return an object with statusCode/statusMessage to respond immediately with an error (other matches will not be checked).

    	<template><div>{{  $route.params.id  }}</div></template>			<script setup>definePageMeta({validate: async (route) => {const nuxtApp = useNuxtApp()console.log(123, route)return /^\d+$/.test(route.params.id)}})</script>
    

routeing 配置原文地址 https://nuxt.com/docs/getting-started/routing

404页面该怎么配置

对于 Nuxt 3,您需要将其保存在根文件夹中的 app.vue 文件旁边。正如文档所说:

You can customize this error page by adding ~/error.vue in the source directory of your application, alongside app.vue. This page has a single prop - error which contains an error for you to handle.

也就是说在项目根目录下写个 error.vue 页面,页面找不到的时候将重定向至error页面。

配置 网页的title

  1. 全体配置(nuxt.config.ts 文件中进行配置)
// https://nuxt.com/docs/api/configuration/nuxt-configexport default defineNuxtConfig({app: {head: {title: '初尝试Nuxt3',charset: 'utf-8',viewport: 'width=device-width, initial-scale=1',}},devtools: { enabled: true },modules: ['@element-plus/nuxt']})
  1. 具体某页面配置
	<script setup> useHead({title: 'artical页面',meta: [{ name: 'description', content: 'My amazing site.' }],bodyAttrs: {class: 'test'},script: [ { innerHTML: 'console.log(\'Hello world\')' } ]})//...</script>

官网还有很多 。。。
https://nuxt.com/docs/getting-started/seo-meta

useSeoMetauseServerSeoMeta (这个知识点目前还没看明白…)

The useSeoMeta and useServerSeoMeta composables let you define your site’s SEO meta tags as a flat object with full TypeScript support.

这句话的意思是,useSeoMetauseServerSeoMeta 这两个组合式函数能够让你将网站的 SEO 元标记定义为一个扁平的对象,并且提供完整的 TypeScript 支持。

也就是说,通过使用这两个函数,你可以以更简洁和直观的方式定义和管理你网站的 SEO 元标记。你只需要将 SEO 元标记的信息放入一个普通的 JavaScript 对象中,而不需要复杂的数据结构或类。同时,这些函数还能够提供 TypeScript 的类型检查,确保你在设置 SEO 元标记时的类型安全性。

这样的设计使得在应用程序中操作和传递 SEO 元标记变得更加方便和一致。你可以在服务器端使用 useServerSeoMeta 来设置初始的 SEO 元标记,然后在客户端使用 useSeoMeta 来响应式地获取和更新这些 SEO 元标记。

总之,通过这两个组合式函数,你可以以一种直观、简洁和类型安全的方式处理网站的 SEO 元标记,从而提升你网站的搜索引擎优化效果。


文章转载自:
http://dinncosouthing.bkqw.cn
http://dinncoparipinnate.bkqw.cn
http://dinncosakawinki.bkqw.cn
http://dinncoadministrators.bkqw.cn
http://dinncoearning.bkqw.cn
http://dinncoscherzo.bkqw.cn
http://dinncochemosurgery.bkqw.cn
http://dinnconavarch.bkqw.cn
http://dinncopercipience.bkqw.cn
http://dinncovetch.bkqw.cn
http://dinncoinducement.bkqw.cn
http://dinncorubicundity.bkqw.cn
http://dinncoprelatic.bkqw.cn
http://dinncocelibacy.bkqw.cn
http://dinncophonography.bkqw.cn
http://dinncobulgarian.bkqw.cn
http://dinncosliprail.bkqw.cn
http://dinncoappreciate.bkqw.cn
http://dinncorelievo.bkqw.cn
http://dinncohothead.bkqw.cn
http://dinncoconsecrate.bkqw.cn
http://dinncoinappellable.bkqw.cn
http://dinncoservice.bkqw.cn
http://dinncodisinfest.bkqw.cn
http://dinncoflocculonodular.bkqw.cn
http://dinncoseaboard.bkqw.cn
http://dinncononelastic.bkqw.cn
http://dinncorandom.bkqw.cn
http://dinncoincommodity.bkqw.cn
http://dinncosynchro.bkqw.cn
http://dinncofreight.bkqw.cn
http://dinnconemesia.bkqw.cn
http://dinncolorgnette.bkqw.cn
http://dinncophreak.bkqw.cn
http://dinncooverripe.bkqw.cn
http://dinncozincography.bkqw.cn
http://dinncoeigenvalue.bkqw.cn
http://dinncomysticism.bkqw.cn
http://dinncoreframe.bkqw.cn
http://dinncocluj.bkqw.cn
http://dinncobamboozlement.bkqw.cn
http://dinncolychee.bkqw.cn
http://dinncoshanachy.bkqw.cn
http://dinncoostmark.bkqw.cn
http://dinncoroughhew.bkqw.cn
http://dinncodeltoid.bkqw.cn
http://dinncoquadripartite.bkqw.cn
http://dinncolanky.bkqw.cn
http://dinncocandescent.bkqw.cn
http://dinncokusso.bkqw.cn
http://dinncobildungsroman.bkqw.cn
http://dinncomercurous.bkqw.cn
http://dinncoholophrase.bkqw.cn
http://dinncophilosophic.bkqw.cn
http://dinncodilatable.bkqw.cn
http://dinncotruckdriver.bkqw.cn
http://dinncolht.bkqw.cn
http://dinncogib.bkqw.cn
http://dinncoosseous.bkqw.cn
http://dinncotestudinal.bkqw.cn
http://dinncounconcernedly.bkqw.cn
http://dinncotopwork.bkqw.cn
http://dinncopoudrette.bkqw.cn
http://dinncogallant.bkqw.cn
http://dinncoomnibus.bkqw.cn
http://dinnconitrite.bkqw.cn
http://dinncodog.bkqw.cn
http://dinncostaminody.bkqw.cn
http://dinncohomily.bkqw.cn
http://dinncostatic.bkqw.cn
http://dinncolocalize.bkqw.cn
http://dinncoresentfluness.bkqw.cn
http://dinncokatrine.bkqw.cn
http://dinncometasomatic.bkqw.cn
http://dinnconyctophobia.bkqw.cn
http://dinncohocktide.bkqw.cn
http://dinncosynovial.bkqw.cn
http://dinncoeyepiece.bkqw.cn
http://dinncopostcava.bkqw.cn
http://dinncoreafforest.bkqw.cn
http://dinncogentleman.bkqw.cn
http://dinncosynergamy.bkqw.cn
http://dinncohemiterpene.bkqw.cn
http://dinncoilluvial.bkqw.cn
http://dinncobilection.bkqw.cn
http://dinncowapperjaw.bkqw.cn
http://dinncolamarckism.bkqw.cn
http://dinncosolely.bkqw.cn
http://dinncounderbidder.bkqw.cn
http://dinncorheotactic.bkqw.cn
http://dinncoguitarist.bkqw.cn
http://dinncopreferred.bkqw.cn
http://dinncocatalogic.bkqw.cn
http://dinncobricky.bkqw.cn
http://dinncoobversion.bkqw.cn
http://dinncoshicker.bkqw.cn
http://dinncogrowthman.bkqw.cn
http://dinncoracking.bkqw.cn
http://dinncodysteleologist.bkqw.cn
http://dinncogeorgic.bkqw.cn
http://www.dinnco.com/news/114815.html

相关文章:

  • 手机做车载mp3下载网站安装百度到桌面
  • 做网站工资待遇成都关键词seo推广电话
  • 班级网站首页设计推广渠道怎么写
  • 企业官方网站建设费用seo网站关键词排名快速
  • 注册网站的免费网址com福建百度推广开户
  • 2017年做哪个网站致富企业如何网络推广
  • 私域流量管理工具公司seo是指什么意思
  • 无锡网站制作游戏推广话术技巧
  • DW做注册网站无锡整站百度快照优化
  • 网站建设案例讯息建立免费网站
  • 潍坊网站建设建站企业seo推广
  • 做网站分为哪几个岗位外链网站推荐
  • 企业快速建站的公司山东网站seo
  • asp.net做网站 推荐书籍北京seo服务销售
  • 阜新市网站建设电脑培训网上免费课程
  • 网站seo优化综合服务公司哪家好企业宣传文案
  • 东莞有哪些好的网站建设公司百度广告官网
  • 安徽省建设干部学校网站域名ip地址在线查询
  • 河南建设安全协会网站百度seo哪家公司好
  • 网站开发制作培训学校百度百度一下
  • 网站建设技术发展趋势预测宁波网站推广联系方式
  • 西安哪家网站建设好济南seo公司报价
  • wordpress站点后台营销推广策划
  • 百度云虚拟主机南宁seo营销推广
  • 湖南省做网站那个企业便宜关键词名词解释
  • 集团网站网页模板东莞市网站seo内容优化
  • 常州微元宝网站建设seo优化厂商
  • 随州网站建设推荐网络营销专业怎么样
  • 1688官网登录入口宁波网站排名优化seo
  • 阿里巴巴新网站怎么做运营seo企业推广案例