请老师帮忙检查代码,谢谢
来源:1-2 自由编程
叫我丽红
2022-01-26 16:22:08
wxml文件:
<input
type="text"
class="input"
placeholder="请输入内容"
placeholder-class="input-placeholder"
bindinput="addText"
/>
<view>
展示内容:<text class="text">{{text}}</text>
</view>
js文件:
Page({
data:{
text:''
},
addText(e){
const value = e.detail.value;
this.setData({text:value})
}
})
wxss文件:
.input{
width: 500rpx;
height: 40rpx;
line-height: 40rpx;
margin: 10rpx 5rpx;
border: 1rpx solid black;
font-size: 30rpx;
}
.input-placeholder{
color: #ccc;
}
.text{
color: red;
}
1回答
好帮手慕然然
2022-01-26
同学你好,代码实现没问题,很棒,继续加油,祝学习愉快!
相似问题