提交 ab5e624d 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新font-size示例

上级 fce1076c
......@@ -4,7 +4,7 @@ describe('css-font-size', () => {
page = await program.reLaunch('/pages/CSS/text/font-size');
});
it('screenshot', async () => {
it('change font-size screenshot', async () => {
await page.callMethod("setFontSize");
await page.waitFor(100);
const image = await program.screenshot({ fullPage: true });
......
<template>
<view style="flex-grow: 1;">
<view style="height: 250px;background-color: gray;justify-content: center;align-items: center;">
<text ref="text" style="font-size: 15px;">{{fontSize}}</text>
<text ref="text" :style="{'font-size': fontSize}">font-size: {{fontSize}}</text>
<text style="font-size: 30px;">font-size: 30px</text>
</view>
</view>
......@@ -11,14 +11,13 @@
export default {
data() {
return {
fontSize: 'font-size: 15px'
fontSize: '15px'
}
},
methods: {
// 自动化测试
setFontSize() {
this.fontSize = 'font-size: 30px';
(this.$refs['text'] as UniElement).style.setProperty('font-size', '30px');
this.fontSize = '30px';
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册