question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

addons support for input groups

See original GitHub issue

I’ve modified my form-input.vue locally to allow input groups. No real testing has been done outside of my personal use case so no pull request. I’m also pretty sure doing this with named slots would be better to allow for things like checkboxes. I only needed it to add some dollar signs, so this way works for me.

form-input.vue template becomes:

<template>
<div class="input-group">
    <div v-if="addonLeft" v-html="addonLeft" class="input-group-addon"></div>
    <input :type="type" :value="value" :name="name" :id="id || ('b_'+_uid)" :disabled="disabled" ref="input" :is="textarea?'textarea':'input'" :class="['form-control',inputClass]"
        :rows="rows || rowsCount" :placeholder="placeholder" @input="onInput($event.target.value)" @change="onChange($event.target.value)" @keyup="onKeyUp($event)"
        @focus="$emit('focus')" @blur="onBlur()" />
    <div v-if="addonRight" v-html="addonRight" class="input-group-addon"></div>
</div>
</template>

Add props for addonRight and addonLeft…

        addonRight: {
          type: String,
          default: null
        },
        addonLeft: {
          type: String,
          default: null
        },

And then use like this:

<b-form-fieldset label="Price" :label-size="5" horizontal>
  <b-form-input v-model="item.price"addon-left="$"  />
</b-form-fieldset>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
pi0commented, May 7, 2017

@MarZab Thanks for report of typo. Will be fixed in next release soon.

2reactions
pi0commented, Apr 22, 2017

Added in 0.14.0 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Input group
Easily extend form controls by adding text, buttons, or button groups on either side of textual inputs, custom selects, and custom file inputs....
Read more >
Input group · Bootstrap
Multiple add-ons are supported and can be mixed with checkbox and radio input versions. $. $ 0.00.
Read more >
Using input groups (with addons) together with help-text in ...
I'm having a hard time getting Help-texts showing up properly (i.e. at the bottom of the field) with Bootstrap 4's input-groups with add-ons...
Read more >
Bootstrap Input group - examples & tutorial
Responsive Input group built with the latest Bootstrap 5. Extends an input by adding an icon, text, button, or a button group you...
Read more >
Bootstrap input group addon
Now adding a container, two spans and classes all over your pages is quite some work to maintain. Would be great if Mendix...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found