2016-10-16 25 views
0

我在Flexbox的使这个:Flexbox的不换

enter image description here

但文本不换?

我的代码:

<template> 
    <div> 
     <bar :title="title"></bar> 
     <div class="Row Center"> 
      <div class="Profile" v-if="!loading"> 
       <div class="Profile__body"> 
        <div class="Profile__body__title"> 
         <h1>{{ user.name }} {{ user.last_name }}</h1> 
        </div> 

        <div class="Profile__body__content"> 
         <p>Mobiel: {{ user.mobile }}</p> 
        </div> 

        <div class="Profile__body__content"> 
         <p>Email: {{ user.email }}</p> 
        </div> 

        <div class="Profile__body__content"> 
         <p>Functie: {{ user.function }}</p> 
        </div> 

        <div class="Profile__body__content" v-if="user.about"> 
         <p>Over Mij: {{ user.about }}</p> 
        </div> 

        <div class="Profile__body__content"> 
         <p>Corporatie: {{ user.corporation.name }}</p> 
        </div> 
       </div> 
      </div> 

      <div class="Loader" v-if="loading"> 
       <grid-loader :loading="loading" :color="color" :size="size"></grid-loader> 
      </div> 
     </div> 
    </div> 
</template> 

笔:

.Profile 
    panel(100%, 40%) 

.Profile__body 
    panel-body(100%, 100%) 

.Profile__body__title 
    space-between() 
    align-items center 
    border-bottom 1px solid $main-border-color 
    & > h1 
    margin-left 10px 

.Profile__body__content 
    margin 10px 
    flex-wrap wrap 


.Row 
    display flex 
    max-width 1000px 
    margin auto 

.Center 
    display flex 
    align-items center 
    justify-content center 

panel(height = 375, width = 100%, padding = 0px) 
    margin-top 50px 
    margin-bottom 10px 
    padding padding 
    background: $main-text-color 
    height height 
    width width 
    border 1px solid $main-border-color 

panel-body(min-width = 300px, height = 375px, width = 35%) 
    flex-column() 
    min-width min-width 
    height height 
    width width 

任何想法?

回答

4

这不是问题Flexbox的,你需要使用word-break: break-all

.el { 
 
    display: flex; 
 
} 
 
p { 
 
    width: 50px; 
 
    border: 1px solid black; 
 
    word-break: break-all; 
 
}
<div class="el"> 
 
    <p>looooooooooooooooooooooooooooorem</p> 
 
</div>

+0

谢谢!你太棒了! – Jamie

0
.Grid { 
    display: flex; 
    flex-flow: row; 
    flex-wrap: wrap; 
} 
+0

请添加一些解释为什么此代码可以帮助OP。这将有助于提供未来观众可以从中学习的答案。有关更多信息,请参阅[答案]。 –

+0

display:flex; - 这定义了一个flex容器;内联或块取决于给定的值。它为所有直接的孩子提供了一个弹性环境。 –

+0

如果您想进一步了解更多信息,请查看此链接:-https://css-tricks.com/snippets/css/a-guide-to-flexbox/ –