Skip to content

Commit 9b0b287

Browse files
authoredJan 13, 2025··
Fix(application): Set the component name in PascalCase (#1528)
1 parent c5745db commit 9b0b287

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎src/api/application.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ Enregistre un composant global si un nom et une définition de composant sont pa
123123
const app = createApp({})
124124
125125
// enregistre un objet d'options
126-
app.component('my-component', {
126+
app.component('MyComponent', {
127127
/* ... */
128128
})
129129
130130
// récupère un composant enregistré
131-
const MyComponent = app.component('my-component')
131+
const MyComponent = app.component('MyComponent')
132132
```
133133

134134
- **Voir aussi** [Enregistrement des composants](/guide/components/registration)
@@ -156,17 +156,17 @@ Enregistre une directive personnalisée globale si un nom et une définition de
156156
})
157157
158158
// enregistrement (options de directive)
159-
app.directive('my-directive', {
159+
app.directive('myDirective', {
160160
/* custom directive hooks */
161161
})
162162
163163
// enregistrement (raccourci d'une fonction de directive)
164-
app.directive('my-directive', () => {
164+
app.directive('myDirective', () => {
165165
/* ... */
166166
})
167167
168168
// récupère une directive enregistrée
169-
const myDirective = app.directive('my-directive')
169+
const myDirective = app.directive('myDirective')
170170
```
171171

172172
- **Voir aussi** [Directives personnalisées](/guide/reusability/custom-directives)
@@ -636,13 +636,13 @@ Configurer un préfixe pour tous les identifiants générés via [useId()](/api/
636636
- **Example**
637637

638638
```js
639-
app.config.idPrefix = 'my-app'
639+
app.config.idPrefix = 'myApp'
640640
```
641641

642642
```js
643643
// in a component:
644-
const id1 = useId() // 'my-app:0'
645-
const id2 = useId() // 'my-app:1'
644+
const id1 = useId() // 'myApp:0'
645+
const id2 = useId() // 'myApp:1'
646646
```
647647

648648
## app.config.throwUnhandledErrorInProduction <sup class="vt-badge" data-text="3.5+" /> {#app-config-throwunhandlederrorinproduction}

0 commit comments

Comments
 (0)
Please sign in to comment.