Managing column counts in form groups using BootstrapVue

When I use BootstrapVue to create a form group with input fields and select boxes that are dynamically added on a button click, I need to display another element (such as a button or div) to the right of it for removing the field by binding a click event.

Below is an example of my code, taken from the BootstrapVue page.

<b-card bg-variant="light">
    <b-form-group horizontal
                  label="Street:"
                  label-class="text-sm-right"
                  label-for="nestedStreet">
      <b-form-input id="nestedStreet"></b-form-input>
      <div>X</div> # This gets pushed down to the next line...I need it in-line
    </b-form-group>
    <b-form-group horizontal
                  label="City:"
                  label-class="text-sm-right"
                  label-for="nestedCity">
      <b-form-input id="nestedCity"></b-form-input>
    </b-form-group>
    <b-form-group horizontal
                  label="State:"
                  label-class="text-sm-right"
                  label-for="nestedState">
      <b-form-input id="nestedState"></b-form-input>
    </b-form-group>
    <b-form-group horizontal
                  label="Country:"
                  label-class="text-sm-right"
                  label-for="nestedCountry">
      <b-form-input id="nestedCountry"></b-form-input>
    </b-form-group>
</b-card>

BootstrapVue automatically adds a class col-sm-9 to every row in the form-group, causing any additional div element to be pushed down to the next line instead of appearing in-line. Is there a way to set the number of columns in the form-group row?

Answer №1

By utilizing the traditional Bootstrap <div class="form-group"> tag, I discovered that it gives me the flexibility to customize the input field class. Instead of sticking to <b-form-group>, I opted for <div class="form-group">.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Discovering the Vue app container div attribute

I am currently working on a Java app that generates pages server-side based on certain data, such as a publisher for a specific entity. I want to develop a reusable Vue component that can call an API method to request data about the entity that is being vi ...

How to perfectly align a button at the center and position it in the forefront?

I'm attempting to place a button in front of my video and center it on the video. I've tried using position-relative to bring it in front and flex to center it vertically and horizontally, but it's not working as expected. The z-index is cor ...

Vue's keydown event will only fire when elements are in an active state

Encountering a strange issue while attempting to listen for keydown events in Vue.js. The keydown event is attached to a div tag that surrounds the entire visible area: <template> <div class="layout-wrapper" @keydown="handleKey ...

A step-by-step guide on setting up and accessing multiple environment files in Vue/Nuxt JS based on the domain

We have developed a Nuxt.js multi-tenancy website where we need to fetch environment variables based on the domain. We have 5 domains listed below: Note: The source code is the same for all domains. test1.com test2.com test3.com test4.com test5.com When ...

Futuristic routing in VueJS

I've been attempting to dynamically generate routes, but unfortunately I'm facing difficulties as it seems not feasible with Vuejs 3 import { createRouter, createWebHistory } from "vue-router"; import TopMenu from "../layouts/top-m ...

Using VueJs's createElement() to dynamically insert HTML content

I am currently working on a component that converts all icons to SVG format. By the end of my code, I have included the following: return createElement('i', '<SVG>CODE</SVG>' ) In the spot where the SPA ...

Display JSON data using Vue.js

Trying to display JSON file results using Vue.js, with the goal of showing the result in a value. Here is the code snippet: data () { return { fetchData: function () { var self = this; self.$http.get("/api/casetotalactivation", functio ...

What is the best method to transfer information from a What You See Is What You Get editor to a database using Vue.js?

I have recently started using the Vue2Editor in order to streamline my process of sending text and image data to my Firebase database. However, I am encountering an issue where the entered data is not being added successfully. Previously, with traditional ...

Having trouble connecting v-model to vue-date-picker

My experience with the vue-date-picker and v-model for two-way data binding has been interesting. Initially, I set the value to a date (referred as startDate in this case) and printed the passed value (i.e. startDate) in the console. The initial value pa ...

Obtaining the user's IP address using Vue.js

Just started venturing into the world of Vue.js and I'm looking to retrieve a user's IP address within Vue.js. Prior to this, I was using req.ip inside my API, but unfortunately it always returned the IP address of the Vue.js server instead. I ...

Combine children by grouping them using Rails' group_by method, then map

My current method implementation is as follows: def categorised_templates template_categories.all_parents.map do |cat| cat.templates.by_brand(id).group_by(&:category) end end The output of this method is in the format shown below: [{"Communi ...

When creating an async function, the type of return value must be the universal Promise<T> type

https://i.stack.imgur.com/MhNuX.png Can you explain why TSlint continues to show the error message "The return type of an async function or method must be the global Promise type"? I'm confused about what the issue might be. UPDATE: https://i.stac ...

I am experiencing difficulties with Vue.js following the implementation of vue-router

I'm currently working on developing a single-page application and I've been exploring Vue Router for this project. However, I seem to be facing some issues with my code as I can't seem to view the page where the app should run. After integra ...

Sending data from a parent component to a child component through a function

In the process of developing an app, I have implemented a feature where users must select options from four dropdown menus. Upon clicking the "OK" button, I aim to send all the selections to a child component for chart creation. Initially, I passed the sel ...

Compiling SSR index.html file is in progress

Currently using the Go and VueJS stack, but encountered an issue with SSR. The index.html is precompiled with GO to generate meta tags (using html/template) {{ range index . "metaTags" }} <meta {{.Key |safe }}='{{ .Name }}' {{ .Ty ...

vuejs function for modifying an existing note

Method for editing an existing note with Vue.js in a web application This particular application enables users to perform the following tasks: Create a new note View a list of all created notes Edit an existing note Delete an existing note Prog ...

Effortlessly implement CSS styling in a scoped shadow element with Vue3

I am facing an issue with applying styles to an anchor element in my code. Below is a snippet of the code: <template> <custom-button> #shadow-root (open) <a href="#"></a> <other-custom></other-c ...

Using a function as a prop in Vue js to retrieve data from an API

I am facing an issue with a component that I want to decouple from the data fetching implementation. My goal is to be able to pass a data fetching callback as a prop. The reason for this is so that I can easily mock the data fetching process in storybook. ...

"The webpack-dev-server seems to be failing to forward requests to an external domain using the proxy

I'm currently facing an issue with setting up the webpack-dev-server proxy configuration to route api requests to an external domain. Despite my efforts, I am unable to get it to function properly. Below is my configuration: var path = require(&apos ...

Unlocking the potential of Vue within shadow dom environments

I am facing an issue with a shadow DOM that includes the root element and a Vue component. <template> <div class="container"> <div id="app"></div> </div> <script src="http://my-site.com/app/js/vue-compo ...