css - vue 動態獲取圖片作為背景 想實現背景模糊文字不模糊的效果
問題描述

template> <p v-bind:style='{backgroundImage: ’url(’ + albumpic_big + ’)’}'><!-- {{albumpic_big}}--> <p class='header'> <ul> <li class='icon'> <img src='http://m.b3g6.com/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='http://m.b3g6.com/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中 所以不知道怎么辦
問題解答
回答1:<p v-bind:style='{backgroundImage: ’url(’ + albumpic_big + ’)’}'></p><p class='header'> <ul> <li class='icon'> <img src='http://m.b3g6.com/img/unfold.svg'> </li> <li class='songName'> {{songName}} </li> <li class='icon'> <img src='http://m.b3g6.com/img/more.svg'> </li> </ul></p><p>-{{singer}}-</p>讓文字內容獨立出來,再用定位解決怎么樣?回答2:
大神們在哪里><
相關文章:
1. javascript - immutable配合react提升性能?2. javascript - sublime快鍵鍵問題3. Apache 已經把網站根目錄的改為allow from all了,但是服務器還是不能訪問?4. vue.js - Vue 如何像Angular.js watch 一樣監聽數據變化5. css - 寫頁面遇到個布局問題,求大佬們幫解答,在線等,急!~6. javascript - nodejs關于進程間發送句柄的一點疑問7. 配置Apache時,添加對PHP的支持時語法錯誤8. 實現bing搜索工具urlAPI提交9. phpstudy8.1支持win11系統嗎?10. javascript - 移動端上不能實現拖拽布局嗎?

網公網安備