Skip to content

Commit

Permalink
expose preserveWhitespace option in template compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 13, 2016
1 parent 6e96a65 commit 8823fcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vue-template-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ The optional `options` object can contain the following:
Refer to the implementation of some [built-in compile-time directives](https://github.com/vuejs/vue/tree/next/src/platforms/web/compiler/directives).
- `preserveWhitespace`
Defaults to `true`. This means the compiled render function respects all the whitespaces between HTML tags. If set to `false`, all whitespaces between tags will be ignored. This can result in slightly better performance but may affect layout for inline elements.
---
### compiler.compileToFunctions(template)
Expand Down
1 change: 1 addition & 0 deletions src/entries/web-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function compile (
const compiled = baseCompile(template, {
modules,
directives,
preserveWhitespace: options.preserveWhitespace,
warn: msg => {
errors.push(msg)
}
Expand Down

0 comments on commit 8823fcc

Please sign in to comment.