vue3
unicorn-W
助力每一行垃圾代码
展开
-
[NestJs]用户鉴权的简单使用
除了其强大的性能和可扩展性,NestJS的鉴权机制也使得它在构建安全的应用程序方面具有显著优势。通过守卫(Guards)和授权模块,NestJS简化了用户鉴权的过程,使开发者能够专注于业务逻辑,而不是安全细节。一旦您创建了守卫类,您需要将其应用于特定的路由或控制器方法。例如,如果您有一个UserController并希望限制对特定方法的访问,可以在该方法上使用@UseGuards(AuthGuard)装饰器。守卫类是一个使用@Injectable()装饰器的类,并实现了CanActivate接口。原创 2024-01-31 17:14:50 · 613 阅读 · 0 评论 -
v3 异步动态组件创建
异步动态组件创建<template> <div> <component :is="comps[compIndex]['comp']"></component> <button @click="change">切换组件</button> </div></template><script setup lang="ts">import { defineAsyncCompon原创 2022-04-11 15:04:18 · 449 阅读 · 0 评论 -
vue3生命周期
vue3生命周期 onBeforeMount(()=>{ console.log(document.getElementById('test'),'onBeforeMount','组件的根元素还不存在dom还未渲染') }) onMounted(()=>{ console.log(document.getElementById('test'),'onMounted','组件已被渲染,元素可用') }) onBeforeUpdate(()=>{原创 2022-04-11 11:29:34 · 932 阅读 · 0 评论