四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.1 KiB

<template>
<view class="yingbing-content">
<text space="nbsp" :selectable="selectable" :user-select="selectable" :style="[contentStyle]" v-for="(t, i) in item.contents" :key="i">{{t}}</text>
</view>
</template>
<script>
export default {
inject: ['getColor', 'getFontSize', 'getFontFamily', 'getLineGap', 'getSelectable'],
props: {
item: {
type: Object,
default () {
return new Object
}
}
},
computed: {
color () {
return this.getColor()
},
fontSize () {
return this.getFontSize()
},
fontFamily () {
return this.getFontFamily()
},
lineGap () {
return this.getLineGap()
},
selectable () {
return this.getSelectable()
},
contentStyle () {
return {
'color': this.color,
'font-size': this.fontSize + 'px',
'font-family': this.fontFamily,
'margin-top': this.lineGap + 'px',
'height': this.fontSize + 'px'
}
}
}
}
</script>
<style scoped>
.yingbing-content {
box-sizing: border-box;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
</style>