Issues arising with VueJS array props when integrating Bootstrap

I am attempting to display two divs next to each other while iterating through props (which are essentially an array) in VueJS. When I have just a single element, everything functions properly. However, as soon as I include the v-for directive, the elements no longer appear side by side.

<div class="row">
    <div v-for="(data,index) in data" :key="index" class="col-12">
      <div v-if="data.image" class="col-xs-12 col-md-3 image-div">
        <img class="image" :src="data.image" alt="image">
      </div>
      <div class="col-xs-12 col-md-9">
        <p class="title">{{data.title}}</p>
        <p class="description">{{data.description}}</p>
        <p class="bottom">
          <span class="left"><span class="tag">{{data.tag}}</span><span class="time"> | {{data.time}}</span></span>
          <span class="right"><v-icon>bookmark</v-icon><v-icon>share</v-icon></span>
          </p>
      </div>
    </div>
  </div>  

The provided code snippet showcases the approach I am utilizing

Answer №1

It appears that the missing element in your code is the necessary .row for proper grid nesting

<div v-for="(data,index) in data" :key="index" class="col-12">
  <div class="row"> <!-- 👈 this one -->
    <div v-if="data.image" class="col-xs-12 col-md-3 image-div">
      <img class="image" :src="data.image" alt="image">
    </div>
    <div class="col-xs-12 col-md-9">
      <!-- etc -->
    </div>
  </div>
</div>

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

Error with YouTube API in Internet Explorer 8: Video not found

While using the iframe youtube api to handle video, everything runs smoothly on Chrome and Firefox. However, when trying to implement it on Internet Explorer 8, an error saying 'video' is undefined pops up. Any suggestions on how to resolve this ...

Divide a nested list into individual lists

I am working on a navigation menu with nested lists and I need to split the nested lists using jQuery while keeping the original headings intact. Can anyone help me achieve this? Below is the HTML code: <ul id="bigList"> <li><a href="#"& ...

Troubleshooting a resizing problem in Angular's ag-grid

Is there a way to enable column resizing without allowing users to resize columns to the left side and create blank spaces on the right of the grid? Please refer to the image below for clarification. ...

React material ui is not compatible with custom styles that are applied to components

I've developed a unique UserIcon Component that showcases an icon along with accompanying text. Take a look at the code snippet below: import React from "react"; import PropTypes from "prop-types"; import { withStyles, Avatar, Typography } from "@mat ...

Ways to categorize by a particular date

const vehicleDetails = [ { "record_id": "2ff8212f-5ec9-4453-b1f3-91840a3fb152", "status_date_activity": { "On Rent": 1662021991000 } }, { "record_id": "c8c1 ...

Error occurred during production at the latest version. The failure happened in the 'Install dependencies' stage due to the dependency_installation script returning a non-zero exit code of 1

Encountering errors when trying to publish my site for the first time on Netlify 7:24:28 PM: build-image version: 3d3c7e8b4321e2c1a54a2c4584fb46ba742b1630 (focal) 7:24:28 PM: buildbot version: 72ed9578274f76ae72cdce4c5312615aeecc32fb 7:24:28 PM: Building w ...

When utilizing the post method with fetch to send data, an empty object is returned

Here is my code snippet for handling the addEventListener for the click event export const showTicket = async function() { try { // FETCHING USER DATA const response = await fetch("/api/v1/users/me"); const data = await response.json(); ...

Issue with div element not functioning properly within table declaration on Internet Explorer

There seems to be an issue with the div tag not functioning properly inside a table definition: <table> <tr></tr> <div id="choice"><tr> <td>-------</td> <td>-------</td> <td>-------</td> &l ...

Error encountered while using the getJSON code syntax

Is there an issue with this code snippet? I am receiving a syntax error on line 1: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Demo</title> </head> <body> <script src="http:/ ...

Is there a way to turn off step navigation in bootstrap?

Displayed below is a visual representation of the bootstrap step navigation component. Presently, there is an unseen 'next' button located at the bottom of the page. When this 'next' button is pressed, it transitions from 'step-1 ...

Is it possible to cache an html page and display it on the current page when reloading?

I have been attempting to design a webpage with links in a table that trigger modals when clicked. These links are added dynamically using Jquery. $("table").append('<tr><td><a href="#exampleModal" data-bs-t ...

Can you show me how to condense this using the ternary operator?

Although I don't necessarily have to refactor this code, I am intrigued by the idea of doing so. handleError: ({ error, email, password }, props) => authError => { if (email === "" || password === "") { return { error: `Plea ...

What is the best way to loop through an API response in Vue.js?

Hey there, I'm new to Vue and struggling with iterating through data in my template. Despite being able to log everything properly, I can't seem to render it on the page. Here's the API URL: https://private-922d75-recruitmenttechnicaltest.a ...

Find out whether the object is located behind another item

Is there a method to determine if elementA is "obscured" by another element, meaning it is not visible to the user? We could potentially achieve this using stacking context, but the challenge lies in identifying which elements to compare. This would requi ...

The icons from MaterializeCSS are not displaying correctly on the navbar within an Angular 7 project

Having an issue implementing MaterializeCSS Icons on the navbar. The arrow-drop_down icon is not displaying correctly, showing only text instead. Oddly enough, the icons render properly on other pages except for the app.component.html file. I attempted to ...

Displaying colors using Javascript

When using node.js to create an HTML file from a js file, I am encountering an issue where the colors are not displaying in the output. I have generated hex values for the colors, but they do not appear in the HTML file as expected. var format; function ...

Utilize the WebGLRenderTarget again

In my project, I am working with two scenes: the main scene which displays a textured plane, and a secondary scene that needs to be rendered to a texture. This texture will serve as a map for the main scene's plane. Although most THREE.WebGLRenderTar ...

Unable to perform multi-delete action upon clicking the checkbox button as intended

Within my GridView, I have implemented a Multi-delete feature. Below is the code snippet for your reference:- <script type="text/javascript> function ValidateAll() { var chkselectcount = 0; var gridview = document.getElementById( ...

The functionality of jQuery is not properly integrating with Materialize for hiding select options

For a project I'm working on, I have implemented two Select elements in the HTML code. The second select should only be enabled when the first select meets certain conditions. You can check out the JSfiddle link for reference. $(document).ready(f ...

Using Three.js to create a blurred SVG texture from a canvas

I am attempting to apply an SVG as a texture over a model with UV mapping, but it appears very blurry. I'm using the texture from a 2D canvas, which looks fine on its own, but once applied to the model, it doesn't look good at all. Any suggestion ...