类似气泡的样式demo

实现如上样式的代码。以下只是一个demo

js的代码:

Ext.define('XDS.view.main.Main', {
    extend: 'Ext.DataView',
    xtype: 'app-main',

    requires: [
        'Ext.MessageBox',


        'XDS.view.main.MainController',
        'XDS.view.main.MainModel',
        'XDS.view.main.List'
    ],


    controller: 'main',
    viewModel: 'main',

//样式
   cls:'userProfile',
   store: {
        fields: ['name', 'age'],
        data: [
            {name: 'Peter',  age: 26},
            {name: 'Ray',   age: 21},
            {name: 'Egon', age: 24},
            {name: 'Winston', age: 24}
        ]
    },
//需要解决最后一项时,不再有line-wrap下面的before.判断是不是dataview的最后一项,若是就隐藏!
itemTpl:Ext.create('Ext.XTemplate',
'<div class="timeline-item x-item-select" role="option" tabindex="-1" data-recordindex="1" data-recordid="104" data-boundview="profiletimeline-1134" aria-selected="true">',
'<div class="profile-pic-wrap">',
'<img src="http://img3.duitang.com/uploads/item/201402/19/20140219214112_VHNVS.jpeg" width="60" height="60">',
'<div>2 小时</div>',
'</div>',
'<div class="line-wrap">',
'<div class="contents-wrap">',
'<div class="job-meeting">',
'<a href="#">Job Meeting</a>',
'</div>',
'<div>"hahhahahahahahahhahahah"</div>',
'</div>',
'</div>',
'</div>'
)

});

scss样式代码,可根据自己的需要进行修改:

.userProfile {


.timeline-item .contents-wrap .job-meeting a {
color: #35baf6;
text-decoration: none;
font-weight: bold;
margin-bottom: 10px;
display: block;
}

.timeline-item .line-wrap:before {
content: "";
position: absolute;
width: 50px;
height: 100%;
border-right: solid 2px #35baf6;
left: 0;
top: 70px;
}

.timeline-item .profile-pic-wrap img {
height: 46px;
width: 46px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
border-radius: 50%;
}

.timeline-item .profile-pic-wrap {
   width: 100px;
float: left;
font-size: 10px;
text-align: center;
position: relative;
/* background: #fff; */
padding: 5px 0;
}
.timeline-item .contents-wrap {
margin: 0 0px 15px 110px;
border: 1px solid #ddd;
position: relative;
padding: 15px;
white-space: normal;
}
.timeline-item .contents-wrap:before {
border-top: 9px solid transparent;
border-bottom: 9px solid transparent;
border-right: 9px solid #ddd;
margin: 15px 0 0 -9px;
}
.timeline-item .contents-wrap:after {
border-top: 9px solid transparent;
border-bottom: 9px solid transparent;
border-right: 9px solid #fff;
margin: 15px 0 0 -8px;
}
.timeline-item .contents-wrap:before, .timeline-item .contents-wrap:after {
content: "";
display: block;
position: absolute;
width: 0;
height: 0;
left: 0;
top: 0;
}
/*控制左边竖线的位置*/
.timeline-item .line-wrap {
position: relative;
}
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值