Skip to content

Commit cbd9ad7

Browse files
Merge pull request vuejs#57 from boussadjra/feat/introduction
Feat/introduction
2 parents a43cf97 + d147058 commit cbd9ad7

File tree

9 files changed

+307
-192
lines changed

9 files changed

+307
-192
lines changed

.vitepress/config.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ export const sidebar: ThemeConfig['sidebar'] = {
215215
text: 'إعادة الإستخدام',
216216
items: [
217217
{
218-
text: 'التركيبات',
218+
text: 'المُركَّبات',
219219
link: '/guide/reusability/composables'
220220
},
221221
{
222222
text: 'سمات مُوجهة مخصصة',
223223
link: '/guide/reusability/custom-directives'
224224
},
225-
{ text: 'الإضافات', link: '/guide/reusability/plugins' }
225+
{ text: 'الملحقات', link: '/guide/reusability/plugins' }
226226
]
227227
},
228228
{
@@ -242,7 +242,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
242242
text: 'الإرتقاء و التدرج',
243243
items: [
244244
{
245-
text: '(SFC) المكونات أحادية المستند',
245+
text: '(SFC) المكونات أحادية الملف',
246246
link: '/guide/scaling-up/sfc'
247247
},
248248
{ text: 'الأدوات', link: '/guide/scaling-up/tooling' },
@@ -284,11 +284,11 @@ export const sidebar: ThemeConfig['sidebar'] = {
284284
items: [
285285
{ text: 'نظرة شاملة', link: '/guide/typescript/overview' },
286286
{
287-
text: واجهة برمجة التطبيقات بالتكوين TS',
287+
text: الواجهة التركيبية لبرمجة التطبيقات TS',
288288
link: '/guide/typescript/composition-api'
289289
},
290290
{
291-
text: 'و واجهة برمجة التطبيقات بالخيارات TS',
291+
text: 'و واجهة الخيارات لبرمجة التطبيقات TS',
292292
link: '/guide/typescript/options-api'
293293
}
294294
]
@@ -301,7 +301,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
301301
link: '/guide/extras/ways-of-using-vue'
302302
},
303303
{
304-
text: 'الأسئلة الشائعة عن برمجة واجهة التطبيقات بالتكوين',
304+
text: 'الأسئلة الشائعة عن الواجهة التركيبية لبرمجة التطبيقات',
305305
link: '/guide/extras/composition-api-faq'
306306
},
307307
{
@@ -352,7 +352,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
352352
]
353353
},
354354
{
355-
text: 'واجهة برمجة التطبيقات بالتكوين',
355+
text: 'الواجهة التركيبية لبرمجة التطبيقات',
356356
items: [
357357
{ text: 'setup()دالةال', link: '/api/composition-api-setup' },
358358
{
@@ -378,7 +378,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
378378
]
379379
},
380380
{
381-
text: 'واجهة برمجة التطبيقات بالخيارات',
381+
text: 'واجهة الخيارات لبرمجة التطبيقات',
382382
items: [
383383
{ text: 'الخيارات : الحالة', link: '/api/options-state' },
384384
{ text: 'الخيارات : التصيير', link: '/api/options-rendering' },
@@ -413,7 +413,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
413413
]
414414
},
415415
{
416-
text: 'المكونات أحادية المستند',
416+
text: 'المكونات أحادية الملف',
417417
items: [
418418
{ text: 'مواصفات الصيغة', link: '/api/sfc-spec' },
419419
{ text: '<script setup>', link: '/api/sfc-script-setup' },

.vitepress/theme/components/VueMasteryModal.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ watch(
9898
font-weight: 600;
9999
background-color: var(--vt-c-green);
100100
color: #fff;
101-
margin-right: 18px;
101+
margin-left: 18px;
102102
padding: 8px 1em 8px 3em;
103103
}
104104

.vitepress/theme/styles/index.css

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
@import './inline-demo.css';
55
@import './utilities.css';
66
@import './style-guide.css';
7+
@import './overrides.css';

.vitepress/theme/styles/overrides.css

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.VPSidebar,
2+
.vt-doc.guide,
3+
.VPContentDocOutline,
4+
.edit-link {
5+
direction: rtl;
6+
}
7+
8+
pre {
9+
direction: ltr;
10+
}
11+
.vt-doc .custom-block {
12+
padding: 22px 24px 4px 20px !important;
13+
}
14+
.vt-doc .custom-block:before {
15+
content: 'ⓘ';
16+
position: absolute;
17+
font-weight: 600;
18+
font-size: 15px;
19+
top: 28px;
20+
right: 12px;
21+
}
22+
23+
.vt-doc .custom-block-title {
24+
margin-right: 14px;
25+
}
26+
27+
.vt-doc ul {
28+
padding-left: auto;
29+
padding-right: 1.25rem;
30+
}
31+
32+
.vt-doc ul > li:before {
33+
content: '•';
34+
right: -1.25rem;
35+
}
36+
37+
.ar.vue-mastery-link .description {
38+
margin-right: 16px;
39+
}
40+
41+
.vt-doc a[href^="https://sfc.vuejs.org"]:before
42+
{
43+
padding-right: 2.5px;
44+
}
45+
46+
.vt-doc .header-anchor {
47+
position: absolute;
48+
right: -24px;
49+
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": false
3+
}

glossary.md

+55-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,58 @@
22

33
هذه قائمة ترجمات المصطلحات التقنية التي اتفق عليها فريق الترجمة. تعتبر هذه القائمة المرجع الأساسي للمصطلحات في هذا الموقع.
44

5-
| English | العربية |
6-
| :-------- | ------: |
7-
| Component | مكوّن |
5+
| English | العربية |
6+
| :-------------------- | ---------------------------------: |
7+
| Component | مكوّن |
8+
| Composition API | الواجهة التركيبية لبرمجة التطبيقات |
9+
| Options API | واجهة الخيارات لبرمجة التطبيقات |
10+
| Lifecycle Hooks | خطافات مراحل الحياة |
11+
| Single file component | مكون أحادي الملف |
12+
| instance | نسخة |
13+
| template | قالب |
14+
| render function | دالة التصيير |
15+
| data | البيانات |
16+
| props | الخاصيات |
17+
| computed | الخاصيةالمحسوبة |
18+
| method | التابع |
19+
| function | الدالة |
20+
| watch | خاصية مُراقِبة |
21+
| logic | شيفرة، منطق |
22+
| state | حالة |
23+
| event | حدث |
24+
| lifecycle | مرحلة الحياة |
25+
| hook | خطاف |
26+
| migration | الترقية |
27+
| plugin | ملحق |
28+
| mixin | مزيج |
29+
| tag | وسم |
30+
| directive | مُوجِّه/سمة مُوجِّهة |
31+
| attribute | سمة |
32+
| class | صنف |
33+
| style | (في حالة الـCSS) تنسيق |
34+
| style | نمط/ اسلوب |
35+
| binding | ربط |
36+
| interpolation | اقحام |
37+
| expression | تعبير |
38+
| conditional | شرطي |
39+
| list | قائمة |
40+
| key | مفتاح |
41+
| slot | مدخل |
42+
| ref | مرجع |
43+
| dependency | اعتمادية |
44+
| reactivity | (كإسم للمفهوم) تفاعلية |
45+
| reactive | (كصفة للمتغير) تفاعلي |
46+
| effect | تأثير |
47+
| getter | مُحصِّل |
48+
| setter | مُعيِّن |
49+
| shallow | سطحي |
50+
| deep | عميق |
51+
| raw | خام |
52+
| composable function | دالة مُركَّبة |
53+
| parent component | مكوّن أب/أصلي |
54+
| child component | مكوّن فرعي/ابن |
55+
| mount | وصل |
56+
| unmount | فصل |
57+
| container | مُستوعِب |
58+
| CSS selector | مُحدِّد CSS |
59+
| assets | ملحقات |

src/guide/essentials/application.md

+30-28
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# Creating a Vue Application {#creating-a-vue-application}
1+
# إنشاء تطبيق باستخدام Vue {#creating-a-vue-application}
22

3-
## The application instance {#the-application-instance}
3+
## نسخة التطبيق {#the-application-instance}
44

5-
Every Vue application starts by creating a new **application instance** with the [`createApp`](/api/application#createapp) function:
5+
كل تطبيق Vue ينشأ باستحداث **نسخة تطبيق** جديد عن طريق استخدام دالة [`createApp`](/api/application#createapp) :
66

77
```js
88
import { createApp } from 'vue'
99

1010
const app = createApp({
11-
/* root component options */
11+
/* التوابع الجذرية للمكون */
1212
})
1313
```
1414

1515
## The Root Component {#the-root-component}
1616

17-
The object we are passing into `createApp` is in fact a component. Every app requires a "root component" that can contain other components as its children.
17+
الكائن الذي نمرره إلى دالة `createApp` هو في الأصل مكون. يتطلب كل تطبيق "مكوِّنًا جذريًا" الذي بدوره يمكن أن يحتوي على مكونات أخرى مثل مكوناته الفرعية.
1818

19-
If you are using Single-File Components, we typically import the root component from another file:
19+
إذا كنت تستخدم المكونات أحادية الملف، فعادة ما نستورد المكون الجذر من ملف آخر:
2020

2121
```js
2222
import { createApp } from 'vue'
23-
// import the root component App from a single-file component.
23+
// استيراد المكون الجذر App كمكون أحادي الملف.
2424
import App from './App.vue'
2525

2626
const app = createApp(App)
2727
```
2828

29-
While many examples in this guide only need a single component, most real applications are organized into a tree of nested, reusable components. For example, a Todo application's component tree might look like this:
29+
في حين نحتاج في العديد من الأمثلة عبر هذا الدليل إلى مكون واحد فقط، فإن معظم التطبيقات الحقيقية منظمة عبر ملفات بشكل شجري تحتوي على العديد من المكونات المتداخلة والقابلة لإعادة الاستخدام. على سبيل المثال ، قد تبدو مكونات تطبيق Todo (تطبيق قائمة المهام) كما يلي:
3030

3131
```
32-
App (root component)
32+
App (المكون الجذر)
3333
├─ TodoList
3434
│ └─ TodoItem
3535
│ ├─ TodoDeleteButton
@@ -39,11 +39,11 @@ App (root component)
3939
└─ TodoStatistics
4040
```
4141

42-
In later sections of the guide, we will discuss how to define and compose multiple components together. Before that, we will focus on what happens inside a single component.
42+
في أجزاء قادمة من الدليل، سنناقش كيفية تعريف مكونات متعددة وتركيبها مع بعض. لكن قبل ذلك، سنركز على ما يحدث داخل مكون واحد.
4343

44-
## Mounting the App {#mounting-the-app}
44+
## وصل التطبيق {#mounting-the-app}
4545

46-
An application instance won't render anything until its `.mount()` method is called. It expects a "container" argument, which can either be an actual DOM element or a selector string:
46+
لا تُصيَّر نسخة التطبيق أي شيء حتى يتم استدعاء الدالة `()mount.`. و التي تأخذ عنصر "مُستوعِب" كوسيط و الذي يكون إما عنصر من عقد الـDOM أو أيِّ مُحدِّد CSS :
4747

4848
```html
4949
<div id="app"></div>
@@ -52,14 +52,12 @@ An application instance won't render anything until its `.mount()` method is cal
5252
```js
5353
app.mount('#app')
5454
```
55+
سيُصيَّر محتوى المكون الجذر للتطبيق داخل العنصر المُستوعِب الذي بدوره لا يُعتبر جزءًا من التطبيق.
5556

56-
The content of the app's root component will be rendered inside the container element. The container element itself is not considered part of the app.
57+
لا يجب استدعاء دالة `()mount.`. إلا بعد الانتهاء من جميع اعدادات التطبيق وتسجيل الملحقات. كما نلاحظ أيضًا أن قيمة إرجاع هذه الدالة، هي نسخة المكون الجذر بدلاً من نسخة التطبيق التي تكون من دالة تسجيل الملحقات.
58+
### قالب المكون الجذر في عنصر الـDOM المُستوعِب {#in-dom-root-component-template}
5759

58-
The `.mount()` method should always be called after all app configurations and asset registrations are done. Also note that its return value, unlike the asset registration methods, is the root component instance instead of the application instance.
59-
60-
### In-DOM Root Component Template {#in-dom-root-component-template}
61-
62-
When using Vue without a build step, we can write our root component's template directly inside the mount container:
60+
عند استخدام Vue دون عملية بناء ، يمكننا كتابة قالب المكون الجذر مباشرة داخل العنصر المُستوعِب:
6361

6462
```html
6563
<div id="app">
@@ -81,31 +79,34 @@ const app = createApp({
8179
app.mount('#app')
8280
```
8381

84-
Vue will automatically use the container's `innerHTML` as the template if the root component does not already have a `template` option.
82+
سيستخدم Vue تلقائيًا التابع `innerHTML` من المستوعب كقالب إذا لم يكن المكون الجذر للتطبيق يحتوي بالفعل على خيار القالب ( `template`).
83+
8584

86-
## App Configurations {#app-configurations}
85+
## تهيئة التطبيق {#app-configurations}
86+
87+
تعرض نسخة التطبيق الكائن `config.` كخاصية التي تسمح لنا بتهيئة بعض الخيارات على مستوى جذر التطبيق، على سبيل المثال، التصريح بـ"معالج الأخطاء" على مستوى جذر التطبيق الذي يلتقط الأخطاء من جميع المكونات الفرعية :
8788

88-
The application instance exposes a `.config` object that allows us to configure a few app-level options, for example, defining an app-level error handler that captures errors from all descendant components:
8989

9090
```js
9191
app.config.errorHandler = (err) => {
92-
/* handle error */
92+
/* هنا يُعالج الخطأ */
9393
}
9494
```
9595

96-
The application instance also provides a few methods for registering app-scoped assets. For example, registering a component:
96+
نسخة التطبيق توفر لنا أيضًا بعض التوابع لتسجيل الملحقات على مستوى جذر التطبيق. على سبيل المثال، تسجيل مكون:
9797

9898
```js
9999
app.component('TodoDeleteButton', TodoDeleteButton)
100100
```
101101

102-
This makes the `TodoDeleteButton` available for use anywhere in our app. We will discuss registration for components and other types of assets in later sections of the guide. You can also browse the full list of application instance APIs in its [API reference](/api/application).
102+
تسجيل مكون `TodoDeleteButton` بهذه الطريقة يجعله متاحًا للاستخدام في أي مكان في التطبيق. سنناقش تسجيل المكونات وباقي الملحقات في أجزاء قادمة من الدليل. يمكنك أيضًا استعراض قائمة كاملة من واجهات نسخة التطبيق في [مرجع واجهة برمجة التطبيقات](/api/application).
103+
103104

104-
Make sure to apply all app configurations before mounting the app!
105+
تأكد من تطبيق جميع تهيئات التطبيق قبل توصيله!
105106

106-
## Multiple application instances {#multiple-application-instances}
107+
## نسخ متعددة من التطبيق {#multiple-application-instances}
107108

108-
You are not limited to a single application instance on the same page. The `createApp` API allows multiple Vue applications to co-exist on the same page, each with its own scope for configuration and global assets:
109+
لا يقتصر التطبيق على نسخة واحدة فقط في نفس الصفحة. تسمح الواجهة البرمجية للدالة `createApp` بوجود تطبيقات Vue متعددة في نفس الصفحة، كل تطبيق له نطاقه الخاص للتهيئة والملحقات العامة :
109110

110111
```js
111112
const app1 = createApp({
@@ -119,4 +120,5 @@ const app2 = createApp({
119120
app2.mount('#container-2')
120121
```
121122

122-
If you are using Vue to enhance server-rendered HTML and only need Vue to control specific parts of a large page, avoid mounting a single Vue application instance on the entire page. Instead, create multiple small application instances and mount them on the elements they are responsible for.
123+
124+
إذا كنت تستخدم Vue لتحسين HTML مُصيَّر من الخادم وتحتاجها فقط للتحكم في أجزاء معينة من الصفحة الكبيرة، فتجنب توصيل نسخة واحدة من تطبيق Vue على الصفحة بأكملها. بدلاً من ذلك، قم بإنشاء تطبيقات صغيرة متعددة وتوصيلها على العناصر المسؤولة عنها.

0 commit comments

Comments
 (0)