Skip to content

Commit f664788

Browse files
committed
strict mode
1 parent 2ec3f43 commit f664788

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

source/api/global-api.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ order: 5
99

1010
``` js
1111
{
12-
// print stack trace for warnings?
12+
// enable debug mode. see below for details.
1313
debug: true,
14+
// enable strict mode. see below for details.
15+
strict: false,
1416
// attribute prefix for directives
1517
prefix: 'v-',
1618
// interpolation delimiters
@@ -36,10 +38,17 @@ Vue.config.debug = true // turn on debugging mode
3638

3739
**Debug Mode**
3840

39-
When `Vue.config.debug` is set to true, Vue will automatically use synchronous mode and throw a `debugger` statement when there is a warning. This enables the user to inspect the full stack trace in browser dev tools.
41+
When `Vue.config.debug` is set to true, Vue will:
42+
43+
1. Print stack traces for all warnings.
44+
2. Make all anchor nodes visible in the DOM as Comment nodes. This makes it easier to inspect the structure of the rendered result.
4045

4146
<p class="tip">debug mode is not available in the minified production builds.</p>
4247

48+
**Strict Mode**
49+
50+
By default, Vue components inherit all assets from both the class inheritance chain (via `Vue.extend`) AND their parents in the view hierarchy. In strict mode, components will only be able to inherit assets from the class inheritance chain, but NOT from their parents in the view hierarchy. When strict mode is enabled, assets should be either registered globally, or explicitly depended on by the component that needs them. When enforced, this could result in better component encapsulation and reusability in larger projects.
51+
4352
**Changing Delimiters**
4453

4554
When the delimiters are set for text interpolation, the delimiters for HTML interpolation will be generated by adding one outer-most symbol on both sides:

0 commit comments

Comments
 (0)