如何在Bootstrap-vue中执行Flexbox

发布于 2025-02-07 08:02:19 字数 455 浏览 3 评论 0原文

我正在使用vue.js中的Flex框,但是该项目无法执行功能。代码为

<div class="d-flex">
          <div class="p-2"><p>Resturants</p></div>
          <div class="ml-auto p-2"><b-icon icon="three-dots-vertical"></b-icon></div>
        </div>
        

且输出为输出图像是

您能否详细说明如何解决此任务。

I am using the flex box in vue.js but the project cannot perform the functionality. the code is

<div class="d-flex">
          <div class="p-2"><p>Resturants</p></div>
          <div class="ml-auto p-2"><b-icon icon="three-dots-vertical"></b-icon></div>
        </div>
        

and the output is the output image is

can you elaborate how to solve this task.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨落成白 2025-02-14 08:02:19

无法发表评论,所以我会尝试创建答案。
正如其他人所建议的那样,奇怪的是,您的盒子看起来像这样,而没有任何CSS。
可能的是,该盒子正在从其他组件中获取CSS。
在每个VUE组件中,按如下写入标签,

<style scoped>

这将仅将CSS应用于该组件。
关于您的问题,您可以做类似的事情

<div class="row row-flex">
  <div class="col-6">Content1</div>
  <div class="col-6">Content2</div>
</div>

,然后添加CSS。
希望它能有所帮助

Can't comment, so i'll try to create an answer.
As other have suggested, it's strange that your box looks like this, without any css applied on.
What might be, is that the box is taking css from other components.
In every vue component, write the tag as follows

<style scoped>

this will apply the css only to that certain component.
Regarding your question, you could do something like this

<div class="row row-flex">
  <div class="col-6">Content1</div>
  <div class="col-6">Content2</div>
</div>

And then add your css.
Hope it helped

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文