搜尋

首頁  >  問答  >  主體

css - vue 动态获取图片作为背景 想实现背景模糊文字不模糊的效果

template>
    <p id="playPage" class="blur" v-bind:style="{backgroundImage: 'url(' + albumpic_big + ')'}">
<!--       {{albumpic_big}}-->
            <p class="header">
           <ul>
               <li class="icon">
                    <img src="../img/unfold.svg">
               </li>
               <li class="songName">
                   {{songName}}
               </li>
              <li class="icon">
                  <img src="../img/more.svg">
              </li>
           </ul>
        </p>
        <p>-{{singer}}-</p>
    </p>
</template>

    #playPage{
        width: 100%;
        height: 100%;
        position: relative;
    }
    #playPage.blur{
        position: absolute;
        top: 0;
        left: 0;
        background-size:cover;
        filter: blur(8px)
    }
    #playPage:before{
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        filter: blur(7px);
        z-index: -1;
    }

之前这样我都是直接写伪元素 设置背景图是在伪元素上 但是因为绑定的数据不能写在css中 所以不知道怎么办

伊谢尔伦伊谢尔伦2867 天前694

全部回覆(2)我來回復

  • PHPz

    PHPz2017-04-17 11:59:49

    雷雷

    回覆
    0
  • 阿神

    阿神2017-04-17 11:59:49

    大神們在哪裡><

    回覆
    0
  • 取消回覆