From 646b62b1235c9ddb1756ade6590242c99302894f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 17:22:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[Issues:=20#I8TCHU]=20=E6=B7=BB=E5=8A=A0sty?= =?UTF-8?q?led-components=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/styled-components.md | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 zh-cn/styled-components.md diff --git a/zh-cn/styled-components.md b/zh-cn/styled-components.md new file mode 100644 index 00000000..51247561 --- /dev/null +++ b/zh-cn/styled-components.md @@ -0,0 +1,86 @@ +> 模板版本:v0.0.1 + +

+

styled-components

+

+

+ + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + +#### **yarn** + +```bash +yarn add styled-components +``` + + +#### **npm** + +```bash +npm install styled-components +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import React from 'react'; + +import styled from 'styled-components'; + +// Create a react component that renders an <h1> which is +// centered, palevioletred and sized at 1.5em +const Title = styled.h1` + font-size: 1.5em; + text-align: center; + color: palevioletred; +`; + +// Create a <Wrapper> react component that renders a <section> with +// some padding and a papayawhip background +const Wrapper = styled.section` + padding: 4em; + background: papayawhip; +`; + +function MyUI() { + return ( + // Use them like any other React component – except they're styled! + <Wrapper> + <Title>Hello World, this is my first styled component! + + ); +} +``` + +## 约束与限制 + +## 属性 + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---- | ---- | ---- | -------- | -------- | -------- | +| ThemeProvider | A helper component for theming. | component | No | / | Yes | +| css | The css prop is a convenient way to iterate on your components without settling on fixed component boundaries yet | prop | No | / | Yes | +| toStyleSheet | convert a style object to a stylesheet object | function | No | / | Yes | +| ThemeContext | access the theme object and pass the theme object to the style component | jsx component | No | / | Yes | +| isStyledComponent | A utility to help identify styled components. | function | No | / | Yes | +| withTheme | This is a higher order component factory to get the current theme from a ThemeProvider and pass it to your component as a theme prop. | function | No | / | Yes | +| useTheme | This is a custom hook to get the current theme from a ThemeProvider. | function | No | / | Yes | +| ThemeConsumer | It passes the current theme (based on a ThemeProvider higher in your component tree) as an argument to the child function. From this function, you may return further JSX or nothing. |jsx component | No | / | Yes | +| createGlobalstyle | A helper function to generate a special StyledComponent that handles global styles| function | No | Web | No | +| keyframes | A helper method to create keyframes for animations. | function | No | Web | No | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/styled-components/styled-components/blob/main/LICENSE) ,请自由地享受和参与开源。 -- Gitee From b487e877774536403c95ed933b10a778b6517c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Fri, 5 Jan 2024 16:50:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[Issues:=20#I8TY39]=20=E6=9B=B4=E6=96=B0dee?= =?UTF-8?q?pmerge=E6=96=87=E6=A1=A3v0.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 17 +++++++- zh-cn/styled-components.md | 86 -------------------------------------- 2 files changed, 16 insertions(+), 87 deletions(-) delete mode 100644 zh-cn/styled-components.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md index ae798d8a..97214ee1 100644 --- a/zh-cn/deepmerge.md +++ b/zh-cn/deepmerge.md @@ -1,4 +1,4 @@ -> 模板版本:v0.0.1 +> 模板版本:v0.1.2

deepmerge

@@ -9,6 +9,9 @@

+>[!tip] [Github 地址](https://github.com/TehShrike/deepmerge) + + ## 安装与使用 进入到工程目录并输入以下命令: @@ -74,8 +77,20 @@ deepmerge(x, y) // => output ## 约束与限制 +### 兼容性 + + 在下述版本验证通过: + + ide:4.1.3.413 + sdk:openharmony(api11) 4.1.0.53 + 测试设备:Mate40 Pro(NOH-AN00) + rom:204.1.0.52(C00E52R1P17log) + rnoh:0.72.11 + ## API +详情见 [deepmerge源库地址](https://github.com/TehShrike/deepmerge) + | 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | | ---- | ---- | ---- | -------- | -------- | -------- | | deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | / | Yes | diff --git a/zh-cn/styled-components.md b/zh-cn/styled-components.md deleted file mode 100644 index 51247561..00000000 --- a/zh-cn/styled-components.md +++ /dev/null @@ -1,86 +0,0 @@ -> 模板版本:v0.0.1 - -

-

styled-components

-

-

- - License - -

- -## 安装与使用 - -进入到工程目录并输入以下命令: - -#### **yarn** - -```bash -yarn add styled-components -``` - - -#### **npm** - -```bash -npm install styled-components -``` - - - -下面的代码展示了这个库的基本使用场景: - -```js -import React from 'react'; - -import styled from 'styled-components'; - -// Create a react component that renders an <h1> which is -// centered, palevioletred and sized at 1.5em -const Title = styled.h1` - font-size: 1.5em; - text-align: center; - color: palevioletred; -`; - -// Create a <Wrapper> react component that renders a <section> with -// some padding and a papayawhip background -const Wrapper = styled.section` - padding: 4em; - background: papayawhip; -`; - -function MyUI() { - return ( - // Use them like any other React component – except they're styled! - <Wrapper> - <Title>Hello World, this is my first styled component! - - ); -} -``` - -## 约束与限制 - -## 属性 - -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | -| ---- | ---- | ---- | -------- | -------- | -------- | -| ThemeProvider | A helper component for theming. | component | No | / | Yes | -| css | The css prop is a convenient way to iterate on your components without settling on fixed component boundaries yet | prop | No | / | Yes | -| toStyleSheet | convert a style object to a stylesheet object | function | No | / | Yes | -| ThemeContext | access the theme object and pass the theme object to the style component | jsx component | No | / | Yes | -| isStyledComponent | A utility to help identify styled components. | function | No | / | Yes | -| withTheme | This is a higher order component factory to get the current theme from a ThemeProvider and pass it to your component as a theme prop. | function | No | / | Yes | -| useTheme | This is a custom hook to get the current theme from a ThemeProvider. | function | No | / | Yes | -| ThemeConsumer | It passes the current theme (based on a ThemeProvider higher in your component tree) as an argument to the child function. From this function, you may return further JSX or nothing. |jsx component | No | / | Yes | -| createGlobalstyle | A helper function to generate a special StyledComponent that handles global styles| function | No | Web | No | -| keyframes | A helper method to create keyframes for animations. | function | No | Web | No | - -## 遗留问题 - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/styled-components/styled-components/blob/main/LICENSE) ,请自由地享受和参与开源。 -- Gitee From 716496d7767f2ffaa94a8d594e09e9556761d9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Fri, 5 Jan 2024 16:57:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[Issues:=20#I8TY39]=20=E6=9B=B4=E6=96=B0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3v0.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md index 97214ee1..afc85b38 100644 --- a/zh-cn/deepmerge.md +++ b/zh-cn/deepmerge.md @@ -82,9 +82,13 @@ deepmerge(x, y) // => output 在下述版本验证通过: ide:4.1.3.413 + sdk:openharmony(api11) 4.1.0.53 + 测试设备:Mate40 Pro(NOH-AN00) + rom:204.1.0.52(C00E52R1P17log) + rnoh:0.72.11 ## API -- Gitee