<textarea class="content" :focus="true" :fixed="true" maxlength="250" placeholder="请输入内容..." v-model="content"/>
![m***@qq.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/ede3c1476fc7ed4ae05db2bdc1ab7211.png)
- 发布:2019-01-30 21:32
- 更新:2021-10-29 15:58
- 阅读:5760
![m***@qq.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/ede3c1476fc7ed4ae05db2bdc1ab7211.png)
m***@qq.com (作者) - IT
<template>
<view>
<view class="example">
<button type="primary" @click="change">提交</button>
</view>
<view class="box" v-if="show">
<view class="uni-flex uni-column">
<view class="uni-flex header">
<text style="width: 80px;" @click="btnClick('0')">取消</text>
<text style="flex: 1;"></text>
<text style="width: 80px;" @click="btnClick('1')">确认</text>
</view>
<view class="uni-textarea">
<textarea class="content" :focus="true" :fixed="true" maxlength="250" placeholder="请输入内容..." v-model="content"/>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
show: false,
content: ''
}
},
methods:{
change(){
this.show = true;
},
btnClick: function(type) {
switch (Number(type)){
case 0:
uni.showToast({ title: "点击了取消按钮", icon: "none" });
break;
case 1:
uni.showToast({ title: "点击了确定按钮", icon: "none" });
break;
default:
break;
}
this.show = false;
},
}
}
</script>
<style>
button{
margin: 30upx;
}
.box {
position: fixed;
width: 100%;
height: 160px;
min-height: 160px;
left: 0upx;
bottom: 0upx;
overflow: hidden;
z-index: 1000;
background-color: #FFFFFF;
}
.box .header {
height: 40px;
text-align: center;
align-items: center;
border-bottom: #E7E7E7 1px solid;
}
.box .content {
height: 100px;
background-color: #F7F7F7;
box-sizing: border-box;
}
.box .uni-textarea {
box-sizing: border-box;
padding-left: 30upx;
margin: 10upx 0;
}
</style>
拾柒
我的也不行,你解决了吗
2020-06-13 13:19