Skip to content
官方QQ交流群
技术交流1:87208295   点此加入
技术交流2:787747122   点此加入
官网
云控制台
开放平台
关注微信公众号
代码仓库: 码云

开发

seo

  • 官方
vue
<template>
  <view>
  </view>
</template>
<script setup>
usePageHead({
  title: this.$setSeoTitle('订单管理')
});
</script>
  • 自己封装
vue

<script setup>
import HttpObj from '@/utils/http';
import { buildHead } from '@/utils/seo.js';
buildHead({
  title: '官网解决方案',
  link: [
     { rel: 'stylesheet', href: '/pp/xxxx/css/xxx.css' },
  ]
});
</script>

css合并

https://www.volcengine.com/theme/3660282-R-7-1

cookie和store

https://blog.csdn.net/m0_63281537/article/details/126699761

  • useState使用

  • ~/composables 创建

pinia

https://pinia.vuejs.org/zh/ssr/nuxt.html

滚动条

https://www.cnblogs.com/sese/p/17283886.html

路由中间件

~/middleware 里面创建 ,会自动注册,例如 例如: ~/middleware/auth.global.js

js

export default defineNuxtRouteMiddleware((to, from) => {
  console.log('--AuthRoleUser--', to, from);
  // if (to.params.id === '1') {
  //   return abortNavigation();
  // }
  // return navigateTo('/');

  const storeAuth = useState('store_auth');
  if (!storeAuth.value.authenticated) {
    return navigateTo('/');
  }
});
  • 参考

https://www.jianshu.com/p/bd22637c6447

Copyright © 2017 10yun.com | 十云提供计算服务-IPV6 | ctocode组开发