提交 adb3ff5a 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

perf: 优化通用属性交互文案

上级 f154c120
......@@ -28,7 +28,7 @@
<text class="btn-inner">{{ validateGeneralAttrText }}</text>
</view>
<view class="btn btn-ref uni-common-mt" @click="changeHeight">
<text class="btn-inner">通过 ref 修改高度</text>
<text class="btn-inner">{{changeHeightByRefText}}</text>
</view>
<view class="view-class" :hover-class="hoverClass" ref="view-target">
<text class="text">按下 50 ms 后背景变红</text>
......@@ -65,6 +65,7 @@ export default {
validateGeneralAttrText: '验证基础属性',
hoverClass: 'hover-class',
validateViewAttrText: '验证 view 属性',
changeHeightByRefText: '通过 ref 修改高度',
}
},
methods: {
......@@ -99,6 +100,7 @@ export default {
},
changeHeight(){
const generalTarget = this.$refs['general-target'] as Element
this.changeHeightByRefText = '已通过 ref 修改高度'
generalTarget.style.setProperty('height', '200px')
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册