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>