帮助了 AmazingCounters.com 位小伙伴

uni-app 文本域,v-model 双向绑定操作

 

 

<template>
    <view>
        <!-- 自定义导航栏 -->
        <uni-nav-bar :statusBar="true" rightText="发布" left-icon="back" @click-left="back" @click-right="submit">
            <view class="u-f-ajc" @tap="changelook">
                {{yinsi}}
                <view class="icon iconfont icon-xialazhankai"></view>
            </view>
        </uni-nav-bar>
        <!-- 多行输入框 -->
        <view class="uni-textarea">
            <textarea v-model="text" placeholder="说一句话吧~" />
        </view>
        
        
        
    </view>
</template>

<script>
    let changelook= ['所有人可见', '仅自己可见'];
    import uniNavBar from "../../components/uni-nav-bar/uni-nav-bar.vue";
    export default {
        components:{
            uniNavBar
        },
        data() {
            return {
                yinsi:"所有人可见",
                text:""
            };
        },
        methods:{
            // 返回
            back(){
                uni.navigateBack({ delta: 1 });
            },
            // 发布
            submit(){
                console.log("发布")
            },
            // 隐私
            changelook(){
                uni.showActionSheet({
                    itemList:changelook,
                    success: (res)=> {
                        this.yinsi=changelook[res.tapIndex]
                    }
                });
            }
        }
    }
</script>

<style>
.uni-textarea{
    border: 1upx solid #EEEEEE;
}
</style>

 

posted on 2020-10-14 16:36  云的旋律  阅读(3080)  评论(0编辑  收藏  举报

导航

前端攻城狮分享群