效果:

vue:

<template>
<div class="couponItem">
<div class="itemLeft">
<span class="tagDiv">
<span class="tagLeft">折</span>
</span>
<div>
<p class="price"><strong class="priceNum">{{coupon.cdiscount}}</strong>
<span class="priceIcon">折</span></p>
<p class="coupon">满 {{coupon.minimum}} 元可使用</p>
<p class="coupon">无金额门槛</p>
</div>
</div>
<div class="itemRight">
<p class="couponName"><span class="shopTag">店铺:</span>{{coupon.deptname}}</p>
<p class="useRluer">{{coupon.cname}}</p>
<p class="useTime"><i class="timeEnd">{{coupon.validstart}}至{{coupon.validend}}</i><span class="rightBtn">立即使用</span></p>
</div>
</div>
</template> <script>
export default {
data() {
return {
coupon: {
'cdiscount': 8.8,
'minimum': 10,
'deptname': '好又多',
'cname': '全店通用',
'validstart': '2019-06-26',
'validend': '2019-06-30'
}
}
},
methods: {},
}
</script> <style scoped>
i {
font-style: normal;
} .couponItem {
width: 100%;
height: 1rem;
font-size: .14rem;
position: relative;
overflow: hidden;
background: #fff;
padding: 0 .05rem;
box-sizing: border-box;
text-align: left;
display: flex;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-flexbox;
margin: 1rem 0;
} .itemLeft {
width: 33%;
height: 100%;
background: -webkit-linear-gradient(left, #fa7f6d, #fc5e75);
/* Safari 5.1 - 6.0 */
background: -o-linear-gradient(right, #fa7f6d, #fc5e75);
/* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(right, #fa7f6d, #fc5e75);
/* Firefox 3.6 - 15 */
background: linear-gradient(to right, #fa7f6d, #fc5e75);
/* 标准的语法 */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
margin-right: .1rem;
text-align: center;
} .itemLeft:before {
content: ' ';
width: 0;
height: 100%;
position: absolute;
top: 10px;
right: -2px;
border-right: 3px dotted white;/* 控制右边花纹大小 */
} .itemRight {
flex: 1;
-webkit-box-flex: 1;
-ms-flex: 1;
-moz-flex: 1;
} .rightBtn {
width: .7rem;
color: #fa644b;
border: 1px solid #fa644b;
text-align: center;
font-size: .12rem;
border-radius: 8px;
padding: .03rem 0;
} .coupon {
font-size: .12rem;
text-align: center;
color: #f4f4f4;
white-space: nowrap;
-webkit-transform: scale(0.80);
} .priceIcon {
font-size: .14rem;
margin-left: .05rem;
color: #ffffff;
} .itemLeftBttom {
font-size: .12rem;
} .price {
display: flex;
align-items: center;
justify-content: center;
} .priceNum {
font-size: .3rem;
letter-spacing: -2px;
color: #ffffff;
} .couponName {
font-size: .12rem;
padding: .05rem 0;
margin: .01rem 0 .16rem 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: rgb(77, 77, 77);
} .useRluer {
font-size: .14rem;
color: #4d4d4d;
margin-bottom: .03rem;
border-bottom: 1px dashed #cccccc;
} .useTime {
height: .3rem;
display: flex;
justify-content: space-between;
align-items: center;
font-size: .12rem;
color: #999;
} .timeEnd {
font-size: .12rem;
-webkit-transform-origin-x: 0;
-ms-transform: scale(0.8);
/* IE 9 */
-moz-transform: scale(0.8);
/* Firefox */
-webkit-transform: scale(0.8);
/* Safari 和 Chrome */
-o-transform: scale(0.8);
} .tagDiv {
background: #ff9900;
color: #fff;
position: absolute;
transform: rotate(-45deg);
font-size: .12rem;
left: -.2rem;
text-align: center;
top: -.05rem;
padding: 0 .28rem;
height: .3rem;
line-height: .3rem;
} .tagLeft {
position: absolute;
top: .035rem;
left: .22rem;
transform: rotate(45deg);
font-size: .14rem;
font-weight: bold;
}
</style>

vue 实现邮戳边缘的更多相关文章

  1. React 还是 Vue: 你应该选择哪一个Web前端框架?

    学还是要学的,用的多了,也就有更多的认识了,开发中遇到选择的时候也就简单起来了. 本文作者也做了总结: 如果你喜欢用(或希望能够用)模板搭建应用,请使用Vue    如果你喜欢简单和“能用就行”的东西 ...

  2. vue UI库iview源码解析(2)

    上篇问题 在上篇<iview源码解析(1)>中的index.js 入口文件的源码中有一段代码有点疑惑: /** * 在浏览器环境下默认加载组件 */ // auto install if ...

  3. 一个能拖动,能调整大小,能更新bind值的vue指令-vuedragx

    一. 背景说明 开发一个可自定义组件化门户配置页面,期间采用了vue框架作为前端视图引擎,作为一个刚入手vue的萌新,开发第一个功能就遇到了拦路虎.需要一个拖动并且可改变大小的容器盒子.当时查看vue ...

  4. Vue.Draggable 文档总结

    本文章转自https://blog.csdn.net/zjiang1994/article/details/79809687 Vue.Draggable学习总结 Draggable为基于Sortabl ...

  5. vue和react全面对比(详解)

    vue和react对比(详解) 放两张图镇压小妖怪 本文先讲共同之处, 再分析区别 大纲在此: 共同点: a.都使用虚拟dom b.提供了响应式和组件化的视图组件 c.注意力集中保持在核心库,而将其他 ...

  6. Vue修饰符

    为了方便大家写代码,vue.js给大家提供了很多方便的修饰符,比如我们经常用到的取消冒泡,阻止默认事件等等~ 目录 表单修饰符 事件修饰符 鼠标按键修饰符 键值修饰符 v-bind修饰符(实在不知道叫 ...

  7. 浅尝Vue.js组件(一)

    本篇目录: 组件名 组件注册 全局注册 基础组件的自动化全局注册 局部注册 在模块系统中局部注册 Prop 单向数据流 Prop验证 类型检查 非Prop特性 替换/合并已有的特性 禁用特性继承 自定 ...

  8. vue案例 - vue-awesome-swiper实现h5滑动翻页效果

    说到h5的翻页,很定第一时间想到的是swiper.但是我当时想到的却是,vue里边怎么用swiper?! 中国有句古话叫:天塌下来有个高的顶着. 在前端圈里,总有前仆后继的仁人志士相继挥洒着热汗(这里 ...

  9. vue深入了解组件——自定义事件

    一.事件名 跟组件和prop不同,事件名不存在任何自动化的大小写转换.而是触发的事件名需要完全匹配监听这个事件所用的名称.举个例子,如果重复啊一个camelCase名字的事件: this.$emit( ...

随机推荐

  1. Extremely fast hash algorithm-xxHash

    xxHash - Extremely fast hash algorithm xxHash is an Extremely fast Hash algorithm, running at RAM sp ...

  2. 数据库MySQL--分组查询

    事例使用文件:https://files.cnblogs.com/files/Vera-y/myemployees.zip 分组数据:group by 子句 分组查询语法: select 分组函数,列 ...

  3. postman在有登录认证的情况下进行接口测试!!!

    1.启动自己的项目之后直接使用浏览器进行登录,登陆之后随意点击一个请求,F12找到该请求中请求头的Cookie键值对. 2.将该键值对复制粘贴到postman中的请求Headers中,如下图. 3,请 ...

  4. log4j2 按日期分割,自动清理历史文件

    方式一:定义CronTriggeringPolicy <?xml version="1.0" encoding="UTF-8"?> <Conf ...

  5. WifiManager Wifi 管理器&&知识点

    WifiManager 主要使用的技术: SimpleWifi,MahaApp.Metro控件 一 网卡设置 1.获取所有网卡(NetWorkAdapter类) 方法A 通过API SELECT * ...

  6. Linux命令速查手册(第2版)学习

    第1章.需要了解的命令行相关事项 表1-1 如何在文件名字符中使用特殊字符 字符 建议 / 绝不使用.不能转义 \ 必须转义.避免使用 _ 绝不能作为文件或目录名的第一个字符 [] 必须转义.避免使用 ...

  7. Jmeter使用:操作MySQL

    下载 mysql-connector-java-5.1.46-bin.jar 将驱动包引入测试计划(也可丢入Jmeter安装目录lib文件夹下)  新建配置元件JDBC Connection Conf ...

  8. 二分图建图,并查集求联通——二维等价性传递 cf1012B好题!

    /* 模拟二分图:每个点作为一条边,连接的是一列和一行(抽象成一个点,列在左,行在右) 由题意得 a-b相连,a-c相连,b-d相连,那么d-c就不用再相连了 等价于把二分图变成联通的需要再加多少边 ...

  9. (2)python tkinter-按钮.标签.文本框、输入框

    按钮 无功能按钮 Button的text属性显示按钮上的文本 tkinter.Button(form, text='hello button').pack() 无论怎么变幻窗体大小,永远都在窗体的最上 ...

  10. 用原生js封装轮播图

    原生js封装轮播图 对于初学js的同学来说,轮播图还是一个难点,尤其是原生js封装轮播图代码,下面是我之前做的一个轮播图项目中封装好的一些代码,有需要的同学可以看一下,有什么不懂的可以看注释,注释看不 ...