Skip to content

Commit

Permalink
[input-group-addon] Fix SSR Bugs
Browse files Browse the repository at this point in the history
For an unknown reason SSR fails during rehydration of <b-input-groups> with addons enabled.
Inlining seems fixing problem.
  • Loading branch information
Pooya Parsa committed May 3, 2017
1 parent 832193d commit f6e5cb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
7 changes: 2 additions & 5 deletions lib/components/input-group-addon.vue
@@ -1,14 +1,11 @@
<template>
<span class="input-group-addon" :id="_id">
<div class="input-group-addon" :id="id">
<slot></slot>
</span>
</div>
</template>

<script>
import generateId from '../mixins/generate-id';
export default {
mixins: [generateId],
props: {
id: {
type: String,
Expand Down
11 changes: 5 additions & 6 deletions lib/components/input-group.vue
@@ -1,20 +1,19 @@
<template>
<div :class="classObject">
<slot name="left">
<b-input-group-addon v-if="left" v-html="left"></b-input-group-addon>
<div v-if="left" class="input-group-addon" v-html="left"></div>
</slot>

<slot></slot>
<slot name="right">
<b-input-group-addon v-if="right" v-html="right"></b-input-group-addon>

<slot name="left">

This comment has been minimized.

Copy link
@mosinve

mosinve May 4, 2017

Member

Is it a typo?
slot name = left while child div shows when its 'right'

<div v-if="right" class="input-group-addon" v-html="right"></div>
</slot>
</div>
</template>

<script>
import bInputGroupAddon from './input-group-addon.vue';
export default {
components: {bInputGroupAddon},
computed: {
classObject() {
return [
Expand Down

4 comments on commit f6e5cb7

@tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented on f6e5cb7 May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be because there is no data object (event an empty one {})on the b-input-group-addon component?

@pi0
Copy link
Member

@pi0 pi0 commented on f6e5cb7 May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think as we where just passing and using props...
Problem may be with the process of using "conditional component inside slot and has an slot inside it filled with v-html" :D

@tmorehouse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes :p

@mosinve
Copy link
Member

@mosinve mosinve commented on f6e5cb7 May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the functional components will help us... when they will be available...
vuejs/vue#3977

Please sign in to comment.