收藏本版 |訂閲

Next.js论坛 今日: 0|主題: 296|排名: 77 

  • vue之登录权限
    router.js // 全局路由导航守卫 router.beforeEach((to, from, next) => { const tokenStr = localStorage.getItem('token') if (to.path === '/main' && !tokenStr) { // 证明用户要访问后台主页 next('/login') } else { // 访问的不是后台主页 next() } })   来源:https://www.cnblogs.c ...
    0104 悬壶山人 发表于 2022-6-8 Next.js论坛
  • js iterator protocol & next() All In One
    js iterator protocol & next() All In One .next() // Satisfies both the Iterator Protocol and Iterable const myIterator = { next: function() { // ... }, [Symbol.iterator]: function() { return this; } }; iterator protocol 迭代器协议 // .next() // .next().value // .next().do ...
    049 弓长良 发表于 2022-6-7 Next.js论坛
  • [Next.js] Override the Default Next.js Document
    The Document is like the top level HTML structure of your Next.js application. You can use document to change the default language, set favicon; Because Document only render on Server side, so it doesn't support event such as onClick.... pages/_document.txs import { Html, Head, Main, NextScript } fr ...
    0103 三工区曹到儿 发表于 2022-5-24 Next.js论坛
  • [Next.js] Override the Default App Component in Next.js
    You can override the default App component in Next.js by creating a _app.tsx file and defining your own App component. By doing this, you can use global styles, pass custom props, and more. pages/_app.tsx import type {AppProps} from "next/app"; const App = ({Component, pageProps ...
    0100 起生 发表于 2022-5-24 Next.js论坛
  • [Next.js] Serve Optimized Images Using the Next.js Image Component
    The image component from Next.js comes with excellent performance optimizations that make it worth using. It comes with improved performance, better visual stability, faster page loads, and more! In this lesson you’ll learn how to use this component to serve both local and remote images in your Nex ...
    037 逛青楼 发表于 2022-5-24 Next.js论坛
  • 关于Next.js项目启动后页面空白(控制台报错)问题的排查
    初始化Next.js工程项目后,打开开发环境下的默认地址,页面空白,打开控制台出现如下错题信息: Uncaught TypeError: Cannot read properties of undefined (reading 'forEach') 让人一脸茫然。。 因为是刚初始化的项目,代码也没有改动,所以直接去网上查找相似问题。 最后,将引起问题的原因聚焦到了React的浏览器开发调 ...
    043 宝总 发表于 2022-5-8 Next.js论坛
  • LeetCode每日一练【24】
    Swap Nodes in Pairs 我的提交 介绍 罗里吧嗦 思路 循环遍历链表 交换两个节点 找到下两个节点,继续进行交换 代码 /* * @Author: fox * @Date: 2022-05-05 08:01:04 * @LastEditors: fox * @LastEditTime: 2022-05-05 10:04:31 * @Description: https://leetcode.com/problems/swap-nodes-in-pairs/ */ /** * @de ...
    012 消失的岛 发表于 2022-5-5 Next.js论坛
  • Next.js 在 Serverless 中从踩坑到破茧重生
    本文作者:杨苏博 偏后端的全栈开发,目前负责腾云扣钉的 Cloud Studio 产品。对 WebIDE 领域中的 VS Code 和 Theia IDE 有深入研究与丰富实践;多年 Serverless 领域从业经验,是 Serverless First Malagu 开源框架的作者;热爱开源,敢于创新。 前言 Next.js 是由 Vercel 团队研发的一款全栈应用开发框架,我们使用 Nex ...
    084 饶志恒 发表于 2022-4-26 Next.js论坛
  • vue导航守卫
    main.js router.beforeEach((to, from, next) => { let token = sessionStorage.getItem('token') if (to.meta.require) { if (token) { // 允许进入 next() } else { // 跳登录 } } else { next() } }) router.js { path: '/demo', name: 'demo' component: () => imp ...
    038 东哈俄伊朝族永赢 发表于 2022-4-15 Next.js论坛
  • [Next.js] Hide Sensitive Information from the Consumers of Next.js API
    We'll learn how to use Next.js API Routes to hide sensitive information from the clients. In this case, we're calling the JSON Placeholder API with a "secret" value in the headers. All that sensitive information is hidden from the clients since they don't call, or even know, that we're calling the J ...
    052 油桐树 发表于 2022-4-3 Next.js论坛
  • [Next.js] Add Middleware to an API Route Created with next-connect
    We'll learn how to create a middleware function for next-connect. This middleware will work at the route level, for example, for every request that hits the /api/next-connect-middleware endpoint, or at the HTTP verb level, GET /api/next-connect-middleware import nextConnect from 'next-connect' con ...
    03 小梅笑哈哈 发表于 2022-4-3 Next.js论坛
  • [Next.js] Create an API Route Using the next-connect Package
    We'll learn an alternative way of creating API routes using the next-connect package. next-connect gives us an alternative that would feel familiar to anyone that has worked with Express in the past. https://github.com/hoangvvo/next-connect import nextConnect from "next-connect" const handler = ...
    071 战斗鸡 发表于 2022-4-3 Next.js论坛
  • next.js
    参考:https://nextjs.org/learn/foundations/from-react-to-nextjs/getting-started-with-nextjs next.js是react的一个前端框架。react本质上是一个UI库,用于操作虚拟DOM。next.js是基于react的一个前端框架,类似于springboot,有很多约定俗成的配置。 1 不用脚手架创建next.js项目 在一个空路径下面创建package.json,内 ...
    065 小麻子 发表于 2022-3-31 Next.js论坛
  • js使用reduce对数组求和
    let arr = [3, 4, 5, 2, 1]; let sum = arr.reduce((pre, next) => { pre += next; return pre; }, 0) console.log('结果:', sum); 这是我的签名 来源:https://www.cnblogs.com/zxcv123/p/16070778.html
    080 亭亭玉霖 发表于 2022-3-29 Next.js论坛
  • Next.js的Babel及拆包优化
    1 Babel兼容   1.2 Babel按需加载规则(useBuiltIns)   在Babel>7的条件下,支持通过useBuiltIns参数来实现按需加载必要的垫片。   useBuiltIns=false   不会自动引入垫片。   useBuiltIns=entry   通过@babel/preset-env插件,按照浏览器环境按需加载需要的模块来替换对core-js的直接引用 ...
    030 新能源李陈更 发表于 2022-3-21 Next.js论坛
  • the next generation block styled editor -- eidtor.js
    what’s editor? Next generation block styled editor. Free. Use for pleasure. Editor.js is a block-style editor for rich media stories. It outputs clean data in JSON instead of heavy HTML markup. And more important thing is that Editor.js is designed to be API extendable and pluggable. So there ar ...
    093 谷水潺潺木落翩翩 发表于 2022-3-13 Next.js论坛
  • Next.js -- SSG of React
    SSR https://css-tricks.com/server-side-react-rendering/ react代码在客户端渲染,这样导致SEO不友好。 由此引入,SSR 服务器端渲染技术:ReactDomServer库。 The Benefits of Server-Side Rendering SEO might be the conversation that starts your team talking about server-side rendering, but it’s not the only ...
    048 冯景德 发表于 2022-3-2 Next.js论坛
  • 乘风破浪,遇见未来元宇宙(Metaverse)之面向效率至上的利器Next.js,开启元宇宙时代的前端开发
    什么是Next.js https://www.nextjs.cn 这是一个用于生产环境的React框架 Next.js为您提供生产环境所需的所有功能以及最佳的开发体验:包括静态及服务器端融合渲染、支持TypeScript、智能化打包、路由预取等功能无需任何配置。 为什么选择Next.js 全球领先的公司都在使用并喜爱Next.js 理由 要从头开始使用React构 ...
    074 拿人去试不就行了 发表于 2022-1-15 Next.js论坛
  • 链表
    //JS没有链表,可以用object 模拟链表 const a = { val: 'a'}; const b = { val: 'b'}; const c = { val: 'c'}; const d = { val: 'd'}; a.next = b; b.next = c; c.next = d; //遍历链表 let p = a; while (p) { console.log(p.val); p = p.next; } //插入 const e = { val: 'e'} c.next = e; e.next = d; 来 ...
    024 张德发 发表于 2021-12-13 Next.js论坛
  • Next.js 是怎么做预渲染的
    前言 打开 next.js 官网,首先映入眼帘的是它的 Slogan 和介绍: The React Framework for ProductionNext.js gives you the best developer experience with all the features you need for production: hybrid static & server rendering, TypeScript support, smart bundling, route pre-fetching, and more ...
    013 清風依然 发表于 2021-9-14 Next.js论坛
  • 下一頁 »

    快速發帖

    還可輸入 180 個字符
    您需要登錄後才可以發帖 登錄 | 立即注册

    本版積分規則

    相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

    Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

    在本版发帖返回顶部