You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a custom renderer. By providing platform-specific node creation and manipulation APIs, you can leverage Vue's core runtime to target non-DOM environments.
5
+
تنشئ المصير المخصص. من خلال توفير منصة لإنشاء العقد والتلاعب بالـواجهة البرمجية، يمكنك الاستفادة من وحدة التشغيل الأساسية لـ Vue لاستهداف بيئات غير DOM.
6
6
7
-
-**Type**
7
+
-**النوع**
8
8
9
9
```ts
10
10
function createRenderer<HostNode, HostElement>(
@@ -48,7 +48,7 @@ Creates a custom renderer. By providing platform-specific node creation and mani
48
48
parentNode(node:HostNode):HostElement|null
49
49
nextSibling(node:HostNode):HostNode|null
50
50
51
-
//optional, DOM-specific
51
+
//اختيارية، خاصة بالـ DOM
52
52
querySelector?(selector:string):HostElement|null
53
53
setScopeId?(el:HostElement, id:string):void
54
54
cloneNode?(node:HostNode):HostNode
@@ -61,7 +61,7 @@ Creates a custom renderer. By providing platform-specific node creation and mani
61
61
}
62
62
```
63
63
64
-
-**Example**
64
+
-**مثال**
65
65
66
66
```js
67
67
import { createRenderer } from'@vue/runtime-core'
@@ -74,12 +74,12 @@ Creates a custom renderer. By providing platform-specific node creation and mani
74
74
// ...
75
75
})
76
76
77
-
// `render` is the low-level API
78
-
// `createApp` returns an app instance
77
+
// `render` هي واجهة برمجية منخفضة المستوى
78
+
// `createApp` تعيد نسخة تطبيق
79
79
export { render, createApp }
80
80
81
-
//re-export Vue core APIs
81
+
//إعادة تصدير الواجهة البرمجية للنواة الخاصة بـ Vue
82
82
export*from'@vue/runtime-core'
83
83
```
84
84
85
-
Vue's own `@vue/runtime-dom` is [implemented using the same API](https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/index.ts). For a simpler implementation, check out [`@vue/runtime-test`](https://github.com/vuejs/core/blob/main/packages/runtime-test/src/index.ts)which is a private package for Vue's own unit testing.
85
+
`vue/runtime-dom@` الخاص بـ Vue [مُنفذ باستخدام نفس الواجهة البرمجية](https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/index.ts). للحصول على شيفرة تنفيذية أبسط، تحقق من [`vue/runtime-test@`](https://github.com/vuejs/core/blob/main/packages/runtime-test/src/index.ts)وهو حزمة خاصة لاختبار وحدات Vue.
Copy file name to clipboardExpand all lines: src/api/utility-types.md
+44-44Lines changed: 44 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# Utility Types {#utility-types}
1
+
# الأنواع المساعدة (Typescript) {#utility-types}
2
2
3
-
:::info
4
-
This page only lists a few commonly used utility types that may need explanation for their usage. For a full list of exported types, consult the [source code](https://github.com/vuejs/core/blob/main/packages/runtime-core/src/index.ts#L131).
3
+
:::info
4
+
هذه الصفحة تعرض فقط بعض الأنواع المساعدة المستخدمة بشكل شائع والتي قد تحتاج إلى شرح لاستخدامها. للحصول على قائمة كاملة بالأنواع المصدرة، استشر [الشيفرة المصدرية](https://github.com/vuejs/core/blob/main/packages/runtime-core/src/index.ts#L131).
5
5
:::
6
6
7
-
## PropType\<T> {#proptype-t}
7
+
## <PropType\<T {#proptype-t}
8
8
9
-
Used to annotate a prop with more advanced types when using runtime props declarations.
9
+
يستخدم لتوصيف الخاصية بأنواع أكثر تقدما عند استخدام تصريحات الخاصيات في وقت التشغيل.
10
10
11
-
-**Example**
11
+
-**مثال**
12
12
13
13
```ts
14
14
importtype { PropType } from'vue'
@@ -22,35 +22,35 @@ Used to annotate a prop with more advanced types when using runtime props declar
-**اطلع أيضا على**[دليل - إضافة الأنواع لخاصيات المكون](/guide/typescript/options-api#typing-component-props)
34
34
35
-
## MaybeRef\<T> {#mayberef}
35
+
## <MaybeRef\<T {#mayberef}
36
36
37
-
Alias for `T | Ref<T>`. Useful for annotating arguments of [Composables](/guide/reusability/composables.html).
37
+
اسم بديل لـ `T | Ref<T>`. مفيد لتوصيف الوسائط لـ [الدوال التركيبية](/guide/reusability/composables.html).
38
38
39
-
-Only supported in 3.3+.
39
+
-مدعوم فقط في 3.3+
40
40
41
-
## MaybeRefOrGetter\<T> {#maybereforgetter}
41
+
## <MaybeRefOrGetter\<T {#maybereforgetter}
42
42
43
-
Alias for `T | Ref<T> | (() => T)`. Useful for annotating arguments of [Composables](/guide/reusability/composables.html).
43
+
اسم بديل لـ `T | Ref<T> | (() => T)`. مفيد لتوصيف الوسائط لـ [الدوال التركيبية](/guide/reusability/composables.html).
44
44
45
-
-Only supported in 3.3+.
45
+
-مدعوم فقط في 3.3+
46
46
47
-
## ExtractPropTypes\<T> {#extractproptypes}
47
+
## <ExtractPropTypes\<T {#extractproptypes}
48
48
49
-
Extract prop types from a runtime props options object. The extracted types are internal facing - i.e. the resolved props received by the component. This means boolean props and props with default values are always defined, even if they are not required.
49
+
تستخرج أنواع الخاصيات من كائن خيارات الخاصيات في وقت التشغيل. الأنواع المستخرجة هي الأنواع الداخلية - أي الخاصيات المستبيَنة التي يتلقاها المكون. هذا يعني أن الخاصيات المنطقية والخاصيات التي تحتوي على قيم افتراضية دائمًا ما تكون محددة، حتى لو لم تكن مطلوبة.
50
50
51
-
To extract public facing props, i.e. props that the parent is allowed to pass, use[`ExtractPublicPropTypes`](#extractpublicproptypes).
51
+
من أجل استخراج الخاصيات العامة، أي الخاصيات التي يسمح للأب بتمريرها، استخدم[`ExtractPublicPropTypes`](#extractpublicproptypes).
52
52
53
-
-**Example**
53
+
-**مثال**
54
54
55
55
```ts
56
56
const propsOptions = {
@@ -75,11 +75,11 @@ To extract public facing props, i.e. props that the parent is allowed to pass, u
Used to augment the component instance type to support custom global properties.
109
+
يستخدم لتوسيع نوع نسخة المكون لدعم الخاصيات العامة المخصصة.
110
110
111
-
- **Example**
111
+
- **مثال**
112
112
113
113
```ts
114
114
importaxiosfrom'axios'
@@ -121,17 +121,17 @@ Used to augment the component instance type to support custom global properties.
121
121
}
122
122
```
123
123
124
-
:::tip
125
-
Augmentations must be placed in a module `.ts`or`.d.ts`file. See [Type Augmentation Placement](/guide/typescript/options-api#augmenting-global-properties)for more details.
124
+
:::tip ملاحظة
125
+
يجب وضع التوسيعات في ملف `.ts`أو`.d.ts`مستقل. اطلع على [مكان التوسيعات](/guide/typescript/options-api#augmenting-global-properties)للمزيد من التفاصيل.
126
126
:::
127
127
128
-
-**See also**[Guide - Augmenting Global Properties](/guide/typescript/options-api#augmenting-global-properties)
128
+
-**اطلع أيضا على**[دليل - توسيع الخاصيات العامة](/guide/typescript/options-api#augmenting-global-properties)
Used to augment the component options type to support custom options.
132
+
يستخدم لتوسيع نوع خيارات المكون لدعم الخيارات المخصصة.
133
133
134
-
-**Example**
134
+
-**مثال**
135
135
136
136
```ts
137
137
import { Route } from'vue-router'
@@ -143,17 +143,17 @@ Used to augment the component options type to support custom options.
143
143
}
144
144
```
145
145
146
-
:::tip
147
-
Augmentations must be placed in a module `.ts`or`.d.ts`file. See [Type Augmentation Placement](/guide/typescript/options-api#augmenting-global-properties)for more details.
146
+
:::tip ملاحظة
147
+
يجب وضع التوسيعات في ملف `.ts`أو`.d.ts`مستقل. اطلع على [مكان التوسيعات](/guide/typescript/options-api#augmenting-global-properties)للمزيد من التفاصيل.
-**اطلع أيضا على**[دليل - توسيع الخيارات المخصصة](/guide/typescript/options-api#augmenting-custom-options)
151
151
152
152
## ComponentCustomProps {#componentcustomprops}
153
153
154
-
Used to augment allowed TSX props in order to use non-declared props on TSX elements.
154
+
يستخدم لتوسيع الخاصيات المسموح بها في TSX من أجل استخدام الخاصيات غير المصرح بها على عناصر TSX.
155
155
156
-
-**Example**
156
+
-**مثال**
157
157
158
158
```ts
159
159
declaremodule'vue' {
@@ -166,21 +166,21 @@ Used to augment allowed TSX props in order to use non-declared props on TSX elem
166
166
```
167
167
168
168
```tsx
169
-
//now works even if hello is not a declared prop
169
+
//يعمل الآن حتى لو لم يُصرح بـ hello كخاصية
170
170
<MyComponenthello="world" />
171
171
```
172
172
173
-
:::tip
174
-
Augmentations must be placed in a module `.ts`or`.d.ts`file. See [Type Augmentation Placement](/guide/typescript/options-api#augmenting-global-properties)for more details.
173
+
:::tip ملاحظة
174
+
يجب وضع التوسيعات في ملف `.ts`أو`.d.ts`مستقل. اطلع على [مكان التوسيعات](/guide/typescript/options-api#augmenting-global-properties)للمزيد من التفاصيل.
175
175
:::
176
176
177
177
## CSSProperties {#cssproperties}
178
178
179
-
Used to augment allowed values in style property bindings.
179
+
يستخدم لتوسيع القيم المسموح بها في ربط خاصية التنسيقات.
180
180
181
-
-**Example**
181
+
-**مثال**
182
182
183
-
Allow any custom CSS property
183
+
السماح بأي خاصية CSS مخصصة
184
184
185
185
```ts
186
186
declaremodule'vue' {
@@ -198,12 +198,12 @@ Used to augment allowed values in style property bindings.
0 commit comments