[英]Vue is removing a background-image in and with the style attribule
由于某些原因,vue会同时删除样式属性和背景图像。 这个标签
<section style="background:
url(images/banners/profiles/profile-banner-1.png);" class="profile-banner flex items-end md:items-end md:justify-center p-8">
</section>
当我重新加载页面时,背景图像将闪烁,但随后将其删除。
我注释掉了我所有的组件,看来这是Vue根实例。
const app = new Vue({
el: '#app',
/*data() {
return {
modal: false,
content_type: ''
}
},
methods: {
openModal: function(content_type){
this.modal = !this.modal;
}
} */
});
奇怪的是,它似乎与背景:url属性有关,因为当我使用类似的东西时,它工作得很好:
<section style="background: black;" class="profile-banner flex items-end md:items-end md:justify-center p-8">
</section>
我想知道这是一个错误,还是Vue保留了URL?
也许是因为:url()
吗?
如果是这样,我该如何逃避?
style
属性不应包含任何换行符。 这很好
<section style="background: url(images/banners/profiles/profile-banner-1.png);" .../>
演示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.