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

便宜网站制作请人制作软件的网站

便宜网站制作,请人制作软件的网站,贵阳网站建设哪家便宜,在服务器上运行wordpress一、创建一个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.hyszgw.com/news/49706.html

相关文章:

  • 做推广的网站无锡做网页设计的公司
  • 旅游做攻略网站品牌名字大全
  • 南京红酒网站建设nginx怎么做多个网站
  • 洛阳建设企业网站公司莱芜雪野湖好玩吗
  • c2c电商网站姑苏区网站建设
  • 教做甜品的网站指数
  • 巢湖建设网站高端品牌冰箱
  • 自助建站系统php公司邮箱免费注册
  • 德庆网站建设wordpress调用当前页文章
  • 网站开发与应用 答案网站建设开发设计营销公司山东
  • 天峨县建设局网站professional wordpress pdf
  • 设计师专业网站超简洁网站
  • 网站 公众号信息化建设工作公司简介ppt模板
  • aipage网站建设水产养殖畜禽饲料类网站前端模板
  • 东营网站关键词优化局域网怎么搭建
  • 织梦网站免费模板网站制作技术介绍
  • 网站入口类型wordpress如何套模板建站
  • 南昌网站设计单位公司微信广告平台
  • 厦门建设局网站首页深圳公布最新出行政策
  • 大亨网站开发360房产网
  • 找网站推广工业园区网站模版
  • 怎么做网站文章优化网络设计开发网站
  • 昆明网站建设首选互维怎么分析网站的外链建设情况
  • 电商网站设计教程外贸整合推广
  • 手机网站整站下载高新网站开发多少钱
  • 外贸网站建设入门网站集约化建设规范
  • 自己做的网站提示不安全网站开发制作心得
  • 免费网站访客qq统计系统网络页面设计公司
  • 东乡建设网站钓鱼网站到底怎么做
  • 佛山精品网站建设wordpress 结构解析