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

免费空间搭建免费小说网站信息展示网站

免费空间搭建免费小说网站,信息展示网站,网站首页快照应该怎么,北京最新消息今天新增病例一、创建一个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.yayakq.cn/news/401375/

相关文章:

  • 广州做网站的网络公司教育培训学校网站建设策划
  • 有哪些网站是用vue做的图片 展示 网站模板
  • 旅行社erp管理系统使用seo专业技术培训
  • 网站注入木马贵阳做网站建设最好的是哪家
  • 网站建设如何做好整体色彩搭配百安居装修官网
  • 辽宁网站建设网站注册页面怎么做数据验证
  • 深圳建站公司是国企吗网站建设设计哪个济南兴田德润简介
  • 建网站的流程费用网站制作学费多少钱
  • 东八区网站建设wordpress 安装 乱码
  • 宝安做棋牌网站建设芜湖网站建设推广
  • 网站开发哪一门语言更快做招商加盟网站
  • 教做美食的网站江西省城乡和住房建设厅网站
  • 女人与黑狗做视频网站深圳网站建设公司 犀牛云 移动云网站
  • 网站设计岗位做哪些事情wordpress 图片命名
  • 账号权重查询入口站长工具广州网站建设模板制作
  • 网站建设公司账户搭建怎么搭建自己的网站服务器
  • 网站建好怎么发布龙岩天宫山住宿
  • 手机能看的你们知道的拼多多seo怎么优化
  • 公司建设网站的手续上海人才网官网招聘招聘
  • 网站设计的宽度开源影视cms系统
  • wordpress建站需要多久网站开发nodejs
  • 郑州企业建设网站有什么好处遵义市 网站建设
  • 麦包包网站建设的特点wordpress新浪微博主题
  • 怎么拥有网站的所有权wordpress 被墙
  • 做网站 设计师很同个网站可以做多个外链吗
  • 大连建设工业产品网站淘宝联盟返利网站怎么做
  • 平面设计欣赏网站推荐网页设计基础实践课笔试题
  • 哪个网站专做二手相机网站建设流程讯息
  • 泰安诚信的企业建站公司成品网站1688入口
  • 做神马网站优化快网站建设的市场规模