vue css 多行打点展示

css样式

-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
display: -webkit-box;

生产打包问题

  • 原因:css的这个-webkit-box-orient属性在打包的时候会丢失
  • 解决方案如下
<template lang="pug">
	.sub-notice(:style="lineStyle") {{notice.desc}}
</template>
<script>
  export default {
    computed: {
      lineStyle() {
        return {'-webkit-box-orient': 'vertical'}
      }
    }
  }
</script>
<style scoped lang="stylus">
	.sub-notice
		-webkit-line-clamp 3
	    overflow hidden
	    display -webkit-box
</style>

效果图

效果图

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章