Skip to content

Commit 4cf82d4

Browse files
docs: add the delimiters option (#529)
1 parent c84c5f3 commit 4cf82d4

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

src/api/options-misc.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,29 @@
1010

1111
Another benefit of specifying a `name` option is debugging. Named components result in more helpful warning messages. Also, when inspecting an app in the [vue-devtools](https://github.com/vuejs/vue-devtools), unnamed components will show up as `<AnonymousComponent>`, which isn't very informative. By providing the `name` option, you will get a much more informative component tree.
1212

13+
## delimiters
14+
15+
- **Type:** `Array<string>`
16+
17+
- **Default:** `{{ "['\u007b\u007b', '\u007d\u007d']" }}`
18+
19+
- **Restrictions:** This option is only available in the full build, with in-browser template compilation.
20+
21+
- **Details:**
22+
23+
Sets the delimiters used for text interpolation within the template.
24+
25+
Typically this is used to avoid conflicting with server-side frameworks that also use mustache syntax.
26+
27+
- **Example:**
28+
29+
```js
30+
Vue.createApp({
31+
// Delimiters changed to ES6 template string style
32+
delimiters: ['${', '}']
33+
})
34+
```
35+
1336
## inheritAttrs
1437

1538
- **Type:** `boolean`

src/style-guide/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,28 +1314,31 @@ This is the default order we recommend for component options. They're split into
13141314
1. **Global Awareness** (requires knowledge beyond the component)
13151315
- `name`
13161316

1317-
2. **Template Dependencies** (assets used in the template)
1317+
2. **Template Modifiers** (changes the way templates are compiled)
1318+
- `delimiters`
1319+
1320+
3. **Template Dependencies** (assets used in the template)
13181321
- `components`
13191322
- `directives`
13201323

1321-
3. **Composition** (merges properties into the options)
1324+
4. **Composition** (merges properties into the options)
13221325
- `extends`
13231326
- `mixins`
13241327
- `provide`/`inject`
13251328

1326-
4. **Interface** (the interface to the component)
1329+
5. **Interface** (the interface to the component)
13271330
- `inheritAttrs`
13281331
- `props`
13291332
- `emits`
13301333

1331-
5. **Composition API** (the entry point for using the Composition API)
1334+
6. **Composition API** (the entry point for using the Composition API)
13321335
- `setup`
13331336

1334-
6. **Local State** (local reactive properties)
1337+
7. **Local State** (local reactive properties)
13351338
- `data`
13361339
- `computed`
13371340

1338-
7. **Events** (callbacks triggered by reactive events)
1341+
8. **Events** (callbacks triggered by reactive events)
13391342
- `watch`
13401343
- Lifecycle Events (in the order they are called)
13411344
- `beforeCreate`
@@ -1352,10 +1355,10 @@ This is the default order we recommend for component options. They're split into
13521355
- `renderTracked`
13531356
- `renderTriggered`
13541357

1355-
8. **Non-Reactive Properties** (instance properties independent of the reactivity system)
1358+
9. **Non-Reactive Properties** (instance properties independent of the reactivity system)
13561359
- `methods`
13571360

1358-
9. **Rendering** (the declarative description of the component output)
1361+
10. **Rendering** (the declarative description of the component output)
13591362
- `template`/`render`
13601363

13611364
### Element attribute order <sup data-p="c">recommended</sup>

0 commit comments

Comments
 (0)