Skip to content

Add the delimiters option #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/api/options-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@

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.

## delimiters

- **Type:** `Array<string>`

- **Default:** `{{ "['\u007b\u007b', '\u007d\u007d']" }}`

- **Restrictions:** This option is only available in the full build, with in-browser template compilation.

- **Details:**

Sets the delimiters used for text interpolation within the template.

Typically this is used to avoid conflicting with server-side frameworks that also use mustache syntax.

- **Example:**

```js
Vue.createApp({
// Delimiters changed to ES6 template string style
delimiters: ['${', '}']
})
```

## inheritAttrs

- **Type:** `boolean`
Expand Down
19 changes: 11 additions & 8 deletions src/style-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1314,28 +1314,31 @@ This is the default order we recommend for component options. They're split into
1. **Global Awareness** (requires knowledge beyond the component)
- `name`

2. **Template Dependencies** (assets used in the template)
2. **Template Modifiers** (changes the way templates are compiled)
- `delimiters`

3. **Template Dependencies** (assets used in the template)
- `components`
- `directives`

3. **Composition** (merges properties into the options)
4. **Composition** (merges properties into the options)
- `extends`
- `mixins`
- `provide`/`inject`

4. **Interface** (the interface to the component)
5. **Interface** (the interface to the component)
- `inheritAttrs`
- `props`
- `emits`

5. **Composition API** (the entry point for using the Composition API)
6. **Composition API** (the entry point for using the Composition API)
- `setup`

6. **Local State** (local reactive properties)
7. **Local State** (local reactive properties)
- `data`
- `computed`

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

8. **Non-Reactive Properties** (instance properties independent of the reactivity system)
9. **Non-Reactive Properties** (instance properties independent of the reactivity system)
- `methods`

9. **Rendering** (the declarative description of the component output)
10. **Rendering** (the declarative description of the component output)
- `template`/`render`

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