|
12 | 12 |
|
13 | 13 | ### 🔩 代码段
|
14 | 14 |
|
15 |
| -- 创建一个 Vue 实例 - `nsvue` |
16 |
| -- HTTP Fetch 示例 - `nsfetch` |
17 |
| -- `isIOS` 导入语句 - `nsisios` |
18 |
| -- `isAndroid` 导入语句 - `nsisandroid` |
19 |
| -- NSVue `app` 导入语句 - `nsapp` |
20 |
| -- NSVue `launchEvent` 区块码 - `nslaunchevent` |
21 |
| -- NSVue `$navigateTo(Component)` 语句 - `nsnavigate` |
| 15 | +- `nsvue` - 创建一个 Vue 实例 |
| 16 | +- `nsfetch` - HTTP Fetch 示例 |
| 17 | +- `nsisios` - `isIOS` 导入语句 |
| 18 | +- `nsisandroid` - `isAndroid` 导入语句 |
| 19 | +- `nsapp` - NSVue `app` 导入语句 |
| 20 | +- `nslaunchevent` - NSVue `launchEvent` 区块码 |
| 21 | +- `nsnavigate` - NSVue `$navigateTo(Component)` 语句 |
22 | 22 |
|
23 | 23 | ### ⚙️ UI 片段
|
24 | 24 |
|
25 | 25 | #### 布局
|
26 | 26 |
|
27 | 27 | - Absolute 布局 - `nsabsolute`
|
28 |
| -- Flexbox 布局 - `NSflex` - new |
| 28 | +- Flexbox 布局 - `NSflex` - 新 |
29 | 29 | - Dock 布局 - `nsdock`
|
30 | 30 | - Grid 布局 - `nsgrid`
|
31 | 31 | - Stack 布局 - `nsstack`
|
|
41 | 41 | - Text View - `nstextview`
|
42 | 42 | - Image - `nsimg`
|
43 | 43 | - Border - `nsborder`
|
44 |
| -- BottomNavigation - `NSBottomNav` - new |
45 |
| -- TabStrip - `NSTabStrip` - new |
46 |
| -- TabStripItem - `NSTabStripItem` - new |
47 |
| -- TabContentItem - `NSTabContentItem` - new |
| 44 | +- BottomNavigation - `NSBottomNav` - 新 |
| 45 | +- TabStrip - `NSTabStrip` - 新 |
| 46 | +- TabStripItem - `NSTabStripItem` - 新 |
| 47 | +- TabContentItem - `NSTabContentItem` - 新 |
48 | 48 | - Button - `nsbtn`
|
49 | 49 | - Search Bar - `nssearchbar`
|
50 | 50 | - Switch - `nsswitch`
|
|
55 | 55 | - Time Picker - `nstime`
|
56 | 56 | - List Picker - `nslistpicker`
|
57 | 57 | - Segmented Bar - `nssegmentedbar`
|
58 |
| -- Scroll View - `NSscrollview` - new |
| 58 | +- Scroll View - `NSscrollview` - 新 |
59 | 59 | - Tab View - `nstabview`
|
60 | 60 | - List View - `nslistview`
|
61 | 61 | - Web View - `nswebview`
|
62 |
| -- Repeater - `NSrepeater` - new |
63 |
| -- Password Field - `NSpassword` - new |
64 |
| -- Action Item - `NSactionItem` - new |
| 62 | +- Repeater - `NSrepeater` - 新 |
| 63 | +- Password Field - `NSpassword` - 新 |
| 64 | +- Action Item - `NSactionItem` - 新 |
65 | 65 |
|
66 | 66 | #### 属性
|
67 | 67 |
|
|
81 | 81 | - borderWidth - `borderWidth`
|
82 | 82 | - translateX - `translateX`
|
83 | 83 | - translateY - `translateY`
|
84 |
| -- scaleX - `scaleX` - new |
85 |
| -- scaleY - `scaleY` - new |
| 84 | +- scaleX - `scaleX` - 新 |
| 85 | +- scaleY - `scaleY` - 新 |
86 | 86 | - margin - `margin`
|
87 | 87 | - opacity - `opacity`
|
88 | 88 | - style - `style`
|
|
123 | 123 |
|
124 | 124 | - tap - `tap`
|
125 | 125 | - @tap - `@tap`
|
126 |
| -- @loaded - `@loaded` - new |
| 126 | +- @loaded - `@loaded` - 新 |
127 | 127 | - doubleTap - `doubleTap`
|
128 | 128 | - longPress - `longPress`
|
129 | 129 | - pan - `pan`
|
|
136 | 136 |
|
137 | 137 | #### 🔓 支持的 CSS 属性 - 新
|
138 | 138 |
|
139 |
| -- color - `color` - Sets a solid-color value to the matched view’s foreground. |
140 |
| -- background - `background` - Sets a solid-color value or a linear gradient to the matched view’s background. |
141 |
| -- background-color - `backgroundColor` - Sets a solid-color value to the matched view’s background. |
142 |
| -- placeholder-color - `placeholderColor` - Sets the placeholder (hint) font color to matched views. |
143 |
| -- background-image - `backgroundImage` - Sets a image url to the matched view’s background image. |
144 |
| -- background-repeat - `backgroundRepeat` - Sets if/how the background image should be repeated. Possible values: repeat, repeat-x, repeat-y, no-repeat |
145 |
| -- background-position - `backgroundPosition` - Sets the starting position of the background image. You can set the position with absolute, percent or alignment values. More info here. |
146 |
| -- background-size - `backgroundSize` - Sets the size of the background image. Possible values: "length length", "percent% percent%", "cover" or "contain". |
147 |
| -- border-color - `borderColor` - Sets border colors to the matched view’s. |
148 |
| -- border-top-color - `borderTopColor` - Sets a top border color to the matched view’s. |
149 |
| -- border-right-color - `borderRightColor` - Sets a right border color to the matched view’s. |
150 |
| -- border-bottom-color - `borderBottomColor` - Sets a bottom border color to the matched view’s. |
151 |
| -- border-left-color - `borderLeftColor` - Sets a left border color to the matched view’s. |
152 |
| -- border-width - `borderWidth` - Sets border widths to the matched view’s. |
153 |
| -- border-top-width - `borderTopWidth` - Sets a top border width to the matched view’s. |
154 |
| -- border-right-width - `borderRightWidth` - Sets a right border width to the matched view’s. |
155 |
| -- border-bottom-width - `borderBottomWidth` - Sets a bottom border width to the matched view’s. |
156 |
| -- border-left-width - `borderLeftWidth` - Sets a left border width to the matched view’s. |
157 |
| -- border-radius - `borderRadius` - Sets a border radius to the matched view’s. |
158 |
| -- font - `font` - Sets the font properties (this includes font-family, font-size, font-style and font-weight) of the matched view. |
159 |
| -- font-family - `fontFamily` - Sets the font family of the matched view. |
160 |
| -- font-size - `fontSize` - Sets the font size of the matched view (only supports device-independent units). |
161 |
| -- font-style - `fontStyle` - Sets the font style of the matched view. Possible values: italic, normal. |
162 |
| -- font-weight - `fontWeight` - Sets the font weight of the matched view Possible values: bold, normal OR 100,200,300,400,500,600,700,800,900, where 400 is normal and 700 is bold (NOTE: Some fonts do not support all available variants) |
163 |
| -- text-align - `textAlignment` - Sets text alignment in the matched view. Possible values: left , center, right. |
164 |
| -- text-decoration - `textDecoration` - Sets the text formatting. Possible values: none, line-through, underline. |
165 |
| -- text-transform - `textTransform` - Sets the text transform. Possible values: none, capitalize, uppercase, lowercase. |
166 |
| -- letter-spacing - `letterSpacing` - Sets the text letter spacing. (On Android API Level 21 and above.) |
167 |
| -- line-height - `lineHeight` - Sets the text line height |
168 |
| -- z-index - `zIndex` - Sets the z-index. (On Android API Level 21 and above.) |
169 |
| -- clip-path - `clip-path` - Sets the clip-path. Supported shapes are circle, ellipse, rect and polygon. You can define your own shape using clippy |
170 |
| -- vertical-align - `verticalAlignment` - Sets the vertical alignment of the current view within its parent. Possible values: top, center, bottom, stretch. |
171 |
| -- horizontal-align - `horizontalAlignment` - Sets the horizontal alignment of the current view within its parent. Possible values: left, center, right, stretch. |
172 |
| -- margin - `margin` - Sets the margin of the view within its parent. |
173 |
| -- margin-top - `marginTop` - Sets the top margin of the view within its parent. |
174 |
| -- margin-right - `marginRight` - Sets the right margin of the view within its parent. |
175 |
| -- margin-bottom - `marginBottom` - Sets the bottom margin of the view within its parent. |
176 |
| -- margin-left - `marginLeft` - Sets the left margin of the view within its parent. |
177 |
| -- width - `width` - Sets the view width. |
178 |
| -- height - `height` - Sets the view height. |
179 |
| -- min-width - `minWidth` - Sets the minimal view width. |
180 |
| -- min-height- `minHeight` - Sets the minimal view height. |
181 |
| -- padding - `padding` - Sets the distance between the boundaries of the layout container and its children. |
182 |
| -- padding-top - `paddingTop` - Sets the top padding of a layout container. |
183 |
| -- padding-right - `paddingRight` - Sets the right padding of a layout container. |
184 |
| -- padding-bottom - `paddingBottom` - Sets the bottom padding of a layout container. |
185 |
| -- padding-left - `paddingLeft` - Sets the left padding of a layout container. |
186 |
| -- visibility - `visibility` - Sets the view visibility. Possible values: visible, collapse (or collapsed). |
187 |
| -- opacity - `opacity` - Sets the view opacity. The value is in the [0, 1] range. |
| 139 | +- color - `color` - 将单色值设置为匹配视图的前景。 |
| 140 | +- background - `background` - 为匹配视图的背景设置纯色值或线性渐变。 |
| 141 | +- background-color - `backgroundColor` - 为匹配视图的背景设置纯色值。 |
| 142 | +- placeholder-color - `placeholderColor` - 将占位符(提示)字体颜色设置为匹配的视图。 |
| 143 | +- background-image - `backgroundImage` - 将图片网址设置为匹配视图的背景图片。 |
| 144 | +- background-repeat - `backgroundRepeat` - 设置是否/如何重复背景图像。 可能的值:repeat,repeat-x,repeat-y,no-repeat。 |
| 145 | +- background-position - `backgroundPosition` - 设置背景图像的起始位置。 您可以使用绝对值,百分比或对齐值设置位置。 更多信息在这里。 |
| 146 | +- background-size - `backgroundSize` - 设置背景图像的尺寸。 可能的值:"length length", "percent% percent%", "cover" 或者 "contain"。 |
| 147 | +- border-color - `borderColor` - 将边框颜色设置为匹配视图的颜色。 |
| 148 | +- border-top-color - `borderTopColor` - 为匹配的视图设置顶部边框颜色。 |
| 149 | +- border-right-color - `borderRightColor` - 为匹配的视图设置右边框颜色。 |
| 150 | +- border-bottom-color - `borderBottomColor` - 将底部边框颜色设置为匹配视图的颜色。 |
| 151 | +- border-left-color - `borderLeftColor` - 将左边框颜色设置为匹配视图的颜色。 |
| 152 | +- border-width - `borderWidth` - 将边框宽度设置为匹配视图的宽度。 |
| 153 | +- border-top-width - `borderTopWidth` - 将顶部边框宽度设置为匹配视图的宽度。 |
| 154 | +- border-right-width - `borderRightWidth` - 为匹配的视图设置右边框宽度。 |
| 155 | +- border-bottom-width - `borderBottomWidth` - 将底部边框宽度设置为匹配视图的宽度。 |
| 156 | +- border-left-width - `borderLeftWidth` - 将左边框宽度设置为匹配视图的宽度。 |
| 157 | +- border-radius - `borderRadius` - 将边框半径设置为匹配视图的边框。 |
| 158 | +- font - `font` - 设置匹配视图的字体属性(包括字体系列,字体大小,字体样式和字体粗细)。 |
| 159 | +- font-family - `fontFamily` - 设置匹配视图的字体系列。 |
| 160 | +- font-size - `fontSize` - 设置匹配视图的字体大小(仅支持与设备无关的单元)。 |
| 161 | +- font-style - `fontStyle` - 设置匹配视图的字体样式。 可能的值:斜体,正常。 |
| 162 | +- font-weight - `fontWeight` - 设置匹配视图的字体粗细可能的值:粗体,普通或 100,200,300,400,500,600,700,800,900,其中 400 为普通,700 为粗体(注意:某些字体不支持所有可用的变体)。 |
| 163 | +- text-align - `textAlignment` - 在匹配的视图中设置文本对齐方式。 可能的值:left,center,right。 |
| 164 | +- text-decoration - `textDecoration` - 设置文本格式。 可能的值:无,直通,下划线。 |
| 165 | +- text-transform - `textTransform` - 设置文本转换。 可能的值:无,大写,大写,小写。 |
| 166 | +- letter-spacing - `letterSpacing` - 设置文本字母间距(在 Android API 级别 21 及更高版本上)。 |
| 167 | +- line-height - `lineHeight` - 设置文字行高。 |
| 168 | +- z-index - `zIndex` - 设置 z-index(在 Android API 级别 21 及更高版本上)。 |
| 169 | +- clip-path - `clip-path` - 设置剪切路径。 支持的形状是圆形,椭圆形,矩形和多边形。 您可以使用 clippy 定义自己的形状。 |
| 170 | +- vertical-align - `verticalAlignment` - 设置当前视图在其父视图中的垂直对齐方式。 可能的值:上,中,下,拉伸。 |
| 171 | +- horizontal-align - `horizontalAlignment` - 设置当前视图在其父视图中的水平对齐方式。 可能的值:左,中,右,拉伸。 |
| 172 | +- margin - `margin` - 在其父级中设置视图的边距。 |
| 173 | +- margin-top - `marginTop` - 设置其父视图内的上边距。 |
| 174 | +- margin-right - `marginRight` - 设置视图在其父视图中的右边距。 |
| 175 | +- margin-bottom - `marginBottom` - 设置视图在其父视图中的底边距。 |
| 176 | +- margin-left - `marginLeft` - 设置视图在其父视图中的左边界。 |
| 177 | +- width - `width` - 设置视图宽度。 |
| 178 | +- height - `height` - 设置视图高度。 |
| 179 | +- min-width - `minWidth` - 设置最小视图宽度。 |
| 180 | +- min-height- `minHeight` - 设置最小视图高度。 |
| 181 | +- padding - `padding` - 设置布局容器及其子项的边界之间的距离。 |
| 182 | +- padding-top - `paddingTop` - 设置布局容器的顶部填充。 |
| 183 | +- padding-right - `paddingRight` - 设置布局容器的正确填充。 |
| 184 | +- padding-bottom - `paddingBottom` - 设置布局容器的底部填充。 |
| 185 | +- padding-left - `paddingLeft` - 设置布局容器的左填充。 |
| 186 | +- visibility - `visibility` - 设置视图可见性。 可能的值:可见,折叠(或折叠)。 |
| 187 | +- opacity - `opacity` - 设置视图不透明度。 该值在[0,1]范围内。 |
188 | 188 |
|
189 | 189 | #### 🔒 NativeScript 特定的 CSS 属性 - 新
|
190 | 190 |
|
191 |
| -- tab-text-color - `tabTextColor` - Sets the text color of the tabs titles. |
192 |
| -- selected-tab-text-color - `selectedTabTextColor` - Sets the color of the text, while selecting some of the tabs. |
193 |
| -- tab-background-color - `tabBackgroundColor` - Sets the background color of the tabs. |
194 |
| -- tab-text-font-size - `tabTextFontSize` - Sets the tab titles font size, without changing the font size of all contents of the tab. |
195 |
| -- text-transform - `textTransform` - Item Sets the text transform individually for every TabViewItem. Value options: capitalize, lowercase, none, and uppercase. |
196 |
| -- android-selected-tab-highlight-color - `androidSelectedTabHighlightColor` - Sets the underline color of the tabs in Android. |
197 |
| -- android-elevation - `androidElevation` - Sets the elevation of the View in Android. |
198 |
| -- android-dynamic-elevation-offset - `androidDynamicElevationOffset` - Sets the elevation of the View in Android, which will be shown when an action was performed(e.g. tap, touch). |
199 |
| -- off-background-color - `offBackgroundColor` - Sets the background color of the Switch when it is turned off. |
200 |
| -- highlight-color - `highlightColor` - Gets or sets the underline color of the selected TabStripItem. |
| 191 | +- tab-text-color - `tabTextColor` - 设置标签标题的文本颜色。 |
| 192 | +- selected-tab-text-color - `selectedTabTextColor` - 选择某些选项卡时,设置文本的颜色。 |
| 193 | +- tab-background-color - `tabBackgroundColor` - 设置选项卡的背景色。 |
| 194 | +- tab-text-font-size - `tabTextFontSize` - 设置选项卡标题的字体大小,而不更改选项卡所有内容的字体大小。 |
| 195 | +- text-transform - `textTransform` - 项目为每个 TabViewItem 分别设置文本转换。 值选项:大写,小写,无和大写。 |
| 196 | +- android-selected-tab-highlight-color - `androidSelectedTabHighlightColor` - 设置 Android 中标签的下划线颜色。 |
| 197 | +- android-elevation - `androidElevation` - 设置 Android 中视图的高程。 |
| 198 | +- android-dynamic-elevation-offset - `androidDynamicElevationOffset` - 设置 Android 中视图的高程,将在执行某项操作(例如点击,触摸)时显示。 |
| 199 | +- off-background-color - `offBackgroundColor` - 设置开关关闭时的背景色。 |
| 200 | +- highlight-color - `highlightColor` - 获取或设置所选 TabStripItem 的下划线颜色。 |
201 | 201 |
|
202 | 202 | #### 🔐 根视图 CSS 类 - 新
|
203 | 203 |
|
204 |
| -- `.ns-root` - a default class |
205 |
| -- `.ns-android`, `.ns-ios` - classes that specify the application platform |
206 |
| -- `.ns-phone`, `.ns-tablet` - classes that specify the device type |
207 |
| -- `.ns-portrait`, `.ns-landscape`, `.ns-unknown` - classes that specify the application orientation |
208 |
| -- `.ns-modal` - a default CSS class is assigned to the root view of any modal view |
| 204 | +- `.ns-root` - 默认类。 |
| 205 | +- `.ns-android`, `.ns-ios` - 指定应用程序平台的类。 |
| 206 | +- `.ns-phone`, `.ns-tablet` - 指定设备类型的类。 |
| 207 | +- `.ns-portrait`, `.ns-landscape`, `.ns-unknown` - 指定应用程序方向的类。 |
| 208 | +- `.ns-modal` - 默认 CSS 类分配给任何模式视图的根视图。 |
209 | 209 |
|
210 | 210 | ## 资源管理器上下文菜单页面创建
|
211 | 211 |
|
|
0 commit comments