【踩坑记录】vue单个组件内<style lang="stylus" type="text/stylus" scoped>部分渲染失效
2024-09-07 07:58:42
vue组件化应用,近期写的单个组件里有一个的渲染部分样式渲染不上去
因为同结构的其他组件均没有问题,所以排除是.vue文件结构的问题,应该是<style>内部的问题
<style lang="stylus" type="text/stylus" scoped>
.recom
height : 3.5rem
padding-bottom : 40%
.title
margin-top : .2rem
line-height : .8rem
background : #eee
text-indent : .2rem
.img
position : relative
overflow : hidden
float :left
width : 50%
height : 0
margin-bottom :21%
.img-content
width : 3.3rem
height : 2.1rem
margin-top :.2rem
margin-left :.2rem
border-radius : .2rem
.img-info
font-size : .23rem
margin-top : .1rem
text-align : center
</style>
问题解决:
最后发现是class的优先级的问题,因为stylus简化了css写法,所以子级别class(被父元素包裹的元素的class)应该在父级别class后严格缩进两格,否则无法识别。
最新文章
- SVG坐标系统
- poi导出excel
- JavaScript内存优化
- July 3rd, Week 28th Sunday, 2016
- ArcServer JS API开发离线部署方法
- cocos2d-x Mask的实现及优化
- java23 XML
- typedef与define
- Nvidia CUDA 6 Installed In Ubuntu 12.04
- nodejs 包引用的终极结论
- NSObject头文件解析 / 消息机制 / Runtime解读 (一)
- 【机器学习】人工神经网络ANN
- ZKWeb网页框架2.0正式发布
- jacascript 原生选项卡插件
- WingIDE 常用快捷键
- json数据格式 net.sf.json.JSONException: A JSONObject text must begin with &#39;{&#39; at character 1 of Error:(findColumns1)Read timed out
- Chrome多线程下载
- Node初识笔记 1第一周
- mysql数据库cup飙升处理思路
- nginx配置tomcat集群
热门文章
- Hello World 之Spring Boot 调用图数据库Neo4j
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十一章:环境光遮蔽(AMBIENT OCCLUSION)
- day39-Spring 18-Spring的JDBC模板:查询的操作
- 洛谷 P2146 [NOI2015]软件包管理器 树链剖分
- 元素的高度(基于vue)
- kubernetes1.4新特性:支持Docker新特性
- innerHTML属性的内存和性能问题
- 【NS2】cygwin+NS2.29安装之道 (转载)
- LeetCode80 Remove Duplicates from Sorted Array II
- oracle trunc(d1[,c1])