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

网站建设的一般步骤百度推广全国代理商排名

网站建设的一般步骤,百度推广全国代理商排名,导航类网站模板,电子商务网站建设问题一、创建一个next项目 使用create-next-app来启动一个新的Next.js应用,它会自动为你设置好一切 运行命令: npx create-next-applatest 执行结果如下: 启动项目: pnpm dev 执行结果: 启动成功! 二、安装Mater…

一、创建一个next项目

使用create-next-app来启动一个新的Next.js应用,它会自动为你设置好一切

运行命令:

npx create-next-app@latest

执行结果如下: 

 启动项目:

pnpm dev

执行结果: 

启动成功! 

二、安装Material UI依赖

根据Material UI官网介绍,截至2021年底,样式组件与服务器渲染的材质UI项目不兼容。这是因为babel-plugin风格的组件不能与@mui包中的styled()实用程序一起工作。有关详细信息,请参阅此GitHub问题。我们强烈建议在SSR项目中使用Emotion。

运行命令:

pnpm add @mui/material @emotion/styled @emotion/react @emotion/cache @mui/icons-material

 三、使用prettier美化项目代码

安装prettier相关依赖,及其文件配置

运行命令:

pnpm add prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-react-hooks -D

prettier文件配置.prettierrc.json

{"semi": true,"endOfLine": "auto","singleQuote": true,"trailingComma": "none","bracketSpacing": true,"jsxBracketSameLine": false,"vueIndentScriptAndStyle": false,"jsxBracketSameLine:": true,"htmlWhitespaceSensitivity": "ignore","wrapAttributes": true,"overrides": [{"files": "*.html","options": {"parser": "html"}}]
}

安装eslint相关依赖:

运行命令:

pnpm  add @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-import-resolver-typescript -D

eslint文件.eslintrc.json配置:

{"root": true,"extends": ["eslint:recommended", "next","prettier"],"env": {"es6": true,"node": true,"browser": true},"parserOptions": {"ecmaVersion": 12,"parser": "@typescript-eslint/parser"},"plugins": ["prettier", "react-hooks","@typescript-eslint"],"parser": "@typescript-eslint/parser","globals": {"chrome": true,"React":true},"settings": {"import/resolver": {"node": {"extensions": [".js", ".jsx", ".ts", ".tsx"]}}},"rules": {"prettier/prettier":"error"}
}

四、使用Prettier自动排序tailwind CSS类

为了使用Prettier自动排序tailwind CSS类,我们需要安装Prettier -plugin-tailwindcss。
运行如下命令安装插件:

pnpm add -D prettier-plugin-tailwindcss

prettier文件配置.prettierrc.json:

{"semi": true,"endOfLine": "auto","singleQuote": true,"trailingComma": "none","bracketSpacing": true,"jsxBracketSameLine": false,"vueIndentScriptAndStyle": false,"jsxBracketSameLine:": true,"htmlWhitespaceSensitivity": "ignore","wrapAttributes": true,"plugins": ["prettier-plugin-tailwindcss"],"overrides": [{"files": "*.html","options": {"parser": "html"}}]
}

五、安装sass

虽然项目当中已经安装了tailwind css进行样式处理,但是有时候不可避免的需要写点样式.因此,安装sass进行,样式的编写:

pnpm add sass -D

至此,一个使用Material UI组件,使用eslint、Prettier进行规范、美化代码的next项目就搭建完毕了。开始你的炫酷旅程吧!

http://www.dtcms.com/wzjs/601967.html

相关文章:

  • 最好的产品网站建设100种迷你小手工
  • 外贸网站建设与优化购物网站开发计划书
  • asp网站免费模板河南建筑公共信息
  • 网站怎么优化排名国际最好的摄影作品网站
  • 网站首页设计怎么做郑州网络推广团队
  • 公司网站怎么做推广什么是网站分析
  • 儋州个人建站哪家好国外网站空间租用哪个好
  • 广州番禺属于哪个区登封搜索引擎优化
  • 做正版电子书下载网站手机版网站开发实例
  • 手机网站开发 c网站卖了对方做违法
  • 网站设计团队有哪些职业哈尔滨网站制作方案定制
  • 无锡企业自助建站系统长沙优秀网站建设
  • 电子商务网站建设前景龙岗做网站
  • 湛江制作网站公司太原市建设工程招标投标网站
  • 搜索引擎有哪些网站西安机械加工网
  • 网站建设情况简介扬州 网站建设
  • 扬中网站建设哪家好公司里开发app的叫什么
  • 做网站app怎么赚钱网页加速器排名
  • 做网站哪家比较好邹城网站制作
  • 做重视频网站网站服务器租赁费高吗
  • 网站建设所有软件清单局域网网站建设协议
  • 网站开发定制公司设计网站推荐知乎
  • 网站域名做链接怎么做商务网站建设与维护 试题
  • 商城网站建站系统动易网站开发
  • 网上做问卷报酬不错的网站是wordpress打字不显示图片
  • 做论坛网站网站加载模式
  • 网站建设需求方案文档网站的ftp服务器
  • 营销网站建立连云港优化推广
  • 太原富库网站建设温州网站推广
  • 企业网站建设存在的问题程序开发步骤不包括