addons support for input groups
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MarZab Thanks for report of typo. Will be fixed in next release soon.
Added in 0.14.0 😃