1. 安装tailwindcssnpm install -D tailwindcss postcss autoprefixer2. 生成tailwindcss 配置文件npx tailwind init -p3. tailwind.config.js 配置/** @type {import('tailwindcss').Config} */ export default { content: [ "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ], theme: { extend...
npm create vite@latest project-name -- --template react 更改project-name为你的项目名称。 这里我们将项目名称取为Demo项目。 所以我们的命令是: npm create vite@latest demo-project -- --template react 该命令将创建我们的项目文件夹。 注意:这里--template react指定我们正在使用 Vite 创建一个 React App...
在Vite 中设置 React 创建Vite 项目后,导航到项目目录并运行npm install。 创建第一个组件 在src文件夹中创建一个新组件,例如Popup.tsx: 代码语言:javascript 复制 importReactfrom"react";constPopup:React.FC=()=>(Hello,Chrome Extension!);exportdefaultPopup; 现在在我们的App.tsx文件中,我们需要导入刚刚创建...
npm config get registry 2 安装VITE npm create vite@latest . -- --template react-ts 3 安装基础依赖 npm install 4 TAILWINDCSS准备工作 4.1 tailwind.config.js /** @type {import('tailwindcss').Config} */ export default { content: [ "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ...
"react-jsx", /* Linting */ "strict": true, "noUnusedLocals": false, "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, "allowSyntheticDefaultImports": true, "noImplicitAny": false, "baseUrl": "./", "paths": { "@/*": ["src/*"] }, "types": ["vite/client", ...
创建Vite 项目 使用Vite 创建一个新的 React 项目: npm create vite@latest my-react-app --template react my-react-app 是你的项目名称,你可以根据需要更改。 进入项目目录 进入你刚刚创建的项目目录: cd my-react-app 安装Tailwind CSS 在项目中安装 Tailwind CSS 及其依赖项: ...
1. 确认 Vite、React、Tailwind CSS 是否已正确安装 首先,确保你的项目中已经安装了 Vite、React 和 Tailwind CSS。你可以通过查看 package.json 文件或使用以下命令来确认: bash npm list vite react tailwindcss 如果这些包不在列表中,你需要通过 npm 或 yarn 安装它们: bash npm install vite react tailwind...
我使用 Vite 创建了一个 React 应用程序,并使用此处提供的文档来安装 Tailwind:Tailwind CSS 安装指南。然而,它并没有采用任何 Tailwind 风格。tailwind.config.cjs/** @type {import('tailwindcss').Config} */ module.exports = { content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], ...
React Tilt是一个很酷的工具,它为我们的网站元素添加了运动和动画效果。通过给元素添加浮动和倾斜效果,使页面看起来更有趣。React Tilt易于使用,为我们的应用程序带来一丝魔法的触感。 入门步骤 首先,使用Vite创建一个新的React应用,并添加TailwindCSS。接下来,添加React Tilt: ...
Vite + React + Tailwind CSS入门 受到 启发 请注意,如果您有权访问 ,则可以按照以下步骤添加它: 安装@tailwindcss/ui : yarn add @tailwindcss/ui 将插件添加到tailwind.config.js无需进行其他任何更改: // tailwind.config.js module . exports = { // ... // rest of the config plugins : [ ...