font-size.uvue 636 字节
Newer Older
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
1 2
<template>
	<view style="flex-grow: 1;">
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
3
		<view style="height: 250px;background-color: gray;justify-content: center;align-items: center;">
4
			<text ref="text" style="font-size: 15px;">{{fontSize}}</text>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
5 6 7 8 9 10
			<text style="font-size: 30px;">font-size: 30px</text>
		</view>
	</view>
</template>

<script>
11 12 13 14 15 16 17 18 19 20 21 22 23 24
  export default {
    data() {
      return {
        fontSize: 'font-size: 15px'
      }
    },
    methods: {
      // 自动化测试
      setFontSize() {
        this.fontSize = 'font-size: 30px';
        (this.$refs['text'] as UniElement).style.setProperty('font-size', '30px');
      }
    }
  }
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
25 26 27 28
</script>

<style>

29
</style>