From 04253d9d8c11842d7ca0b5f81cab07710780a89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=A2=E8=80=BF?= <16479741+xing-g@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 11:17:32 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20[Issue:=20#IDFVO6]=E4=BF=AE=E6=94=B9nat?= =?UTF-8?q?ivewind=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邢耿 <16479741+xing-g@user.noreply.gitee.com> --- zh-cn/nativewind.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/zh-cn/nativewind.md b/zh-cn/nativewind.md index 929e6ef4..2e82aac9 100644 --- a/zh-cn/nativewind.md +++ b/zh-cn/nativewind.md @@ -79,7 +79,7 @@ module.exports = { /** @type {import('tailwindcss').Config} */ module.exports = { + content: ["./src/*.{js,jsx,ts,tsx}"], -+ presets: [require("@react-native-oh-tpl/nativewind/preset")], ++ presets: [require("@react-native-ohos/nativewind/preset")], theme: { extend: {}, }, @@ -102,8 +102,8 @@ module.exports = { ```diff module.exports = { -- plugins: [], -+ plugins: ["@react-native-ohos/nativewind/babel"], +- presets: [], ++ presets: ['module:@react-native/babel-preset'], }; ``` @@ -122,7 +122,7 @@ const config = getDefaultConfig(__dirname) + module.exports = withNativeWind(config, { input: './global.css' }) ``` -#### 创建CSS文件 global.css +#### 在工程根目录下创建CSS文件 global.css > [!TIP] V4.1.24 创建CSS文件 global.css。 @@ -162,15 +162,17 @@ export default NativewindDemo - V4.1.24 ```jsx -import "./global.css" -import { Text, View } from "react-native"; +import "../global.css" +import { Text, View } from 'react-native'; +import { vars } from 'nativewind'; + export default function App() { return ( - - - Welcome to Nativewind! - + + + Welcome to Nativewind! + ); } -- Gitee