Permalink
Browse files

fix(button-close): switch to slots() from children (#1345)

Switching from `children` to `slots().default` appears to fix the original issue with SSR rendering of `×`
  • Loading branch information...
tmorehouse committed Nov 14, 2017
1 parent 4d5a9cc commit 9c997b765430ab94bcbca4ccf10ecc0bcc4245e2
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/components/button/button-close.js
@@ -18,7 +18,7 @@ const props = {
export default {
functional: true,
props,
render(h, { props, data, listeners, children }) {
render(h, { props, data, listeners, slots }) {
const componentData = {
staticClass: "close",
class: {
@@ -40,9 +40,9 @@ export default {
}
};
// Careful not to override the slot with innerHTML
if (!children.length) {
componentData.domProps = { innerHTML: "×" };
if (!slots().default) {
componentData.domProps = { innerHTML: "×" };
}
return h("button", mergeData(data, componentData), children);
return h("button", mergeData(data, componentData), slots().default);
}
};

0 comments on commit 9c997b7

Please sign in to comment.