Blame view

frontend/manage/src/components/portal/datav/DisplayText.vue 676 Bytes
8d73e917   陈威   初始化提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<template>
 <div :style="{textAlign:config.text.textAlign}">
    <span class="text" :style="getStyle()">{{config.text.content}}</span>
  </div> 
</template>
<script>
export default {
  name: "display-text",
  data() {
    return {
    }
  },
  props: {
    config: {
      type: Object
    }
  },
  mounted () {
    
  },
  methods: {
    getStyle(){
      if(this.config.isDiyStyle && this.config.diyStyle){
        return JSON.parse(this.config.diyStyle);
      }else{
        return {fontSize:this.config.text.fontSize,color:this.config.text.color,fontWeight:this.config.text.fontWeight};
      }
    }
  }
};
</script>
<style>
.text {
    display: inline-block;
}
</style>