Skip to content

Commit

Permalink
fix(vue): group slot-scope correctly (#5563)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Nov 29, 2018
1 parent c28dc2f commit 1ecd222
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/language-html/printer-html.js
Expand Up @@ -128,8 +128,10 @@ function embed(path, print, textToDoc, options) {
return concat([
node.rawName,
'="',
mapDoc(embeddedAttributeValueDoc, doc =>
typeof doc === "string" ? doc.replace(/"/g, """) : doc
group(
mapDoc(embeddedAttributeValueDoc, doc =>
typeof doc === "string" ? doc.replace(/"/g, """) : doc
)
),
'"'
]);
Expand Down
4 changes: 4 additions & 0 deletions tests/html_vue/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -26,6 +26,7 @@ printWidth: 80
@click=" $emit( 'click' ) "
@click=" $emit( 'click' ) ;"
@click=" $emit( 'click' ) ;if(something){for(let i=j;i<100;i++){}}else{}"
slot-scope="{row}"
slot-scope="{destructuring:{a:{b}}}"
:class="{ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true }"
:class="(() => { return 'hello' })()"
Expand Down Expand Up @@ -71,6 +72,7 @@ printWidth: 80
} else {
}
"
slot-scope="{ row }"
slot-scope="{
destructuring: {
a: { b }
Expand Down Expand Up @@ -133,6 +135,7 @@ trailingComma: "es5"
@click=" $emit( 'click' ) "
@click=" $emit( 'click' ) ;"
@click=" $emit( 'click' ) ;if(something){for(let i=j;i<100;i++){}}else{}"
slot-scope="{row}"
slot-scope="{destructuring:{a:{b}}}"
:class="{ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true }"
:class="(() => { return 'hello' })()"
Expand Down Expand Up @@ -178,6 +181,7 @@ trailingComma: "es5"
} else {
}
"
slot-scope="{ row }"
slot-scope="{
destructuring: {
a: { b },
Expand Down
1 change: 1 addition & 0 deletions tests/html_vue/attributes.vue
Expand Up @@ -18,6 +18,7 @@
@click=" $emit( 'click' ) "
@click=" $emit( 'click' ) ;"
@click=" $emit( 'click' ) ;if(something){for(let i=j;i<100;i++){}}else{}"
slot-scope="{row}"
slot-scope="{destructuring:{a:{b}}}"
:class="{ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true }"
:class="(() => { return 'hello' })()"
Expand Down

0 comments on commit 1ecd222

Please sign in to comment.