首页 > 编程知识 正文

react点击按钮弹出文本框,uniapp兄弟组件之间传值

时间:2023-05-03 23:38:48 阅读:174870 作者:2163

定制弹出输入框

效果:

主页,定义和使用! 引入uni-popup。 这需要插件市场直接部署到项目中--- uni-popup ref=' show weight ' print weight @ onclick confirm=' onclick confirm ' @ onclickcapup @ 注意! $refs后跟[]。 onClickShow () this.$refs ) (showweight ).open ) )/ok按钮。 弹出框是onClickConfirm ) )隐藏self.$ refs [ ' show weight ' ].close (/script转义框的页面。 组件printweighttemplateviewv-if=' is showmodal ' view class=' masking ' v-if=' show masking ' 3360 style=' { show maw maw==' ' ' { modal title }/viewviewclass=' modal-body ' inputv-model=' input serial num ' style=' padding 336010 rppm fonm ' class=' uni-input ' focus placeholder='设备序列号'/viewviewclass=' BTN cancel ' 3360 style=' { ' color ' 3360 cancence viewviewclass=' BTN confirm ' : style=' { ' color ' : confirmtextcoonfirm } view/view/view/view/templatescriplatescriple 是否显示蒙版show masking 3360 { type : boolean,default3360}蒙版背景色bgcolor:(type:string,default: ) rgba ) //模态框架标题modaltitle3360 ) type:strining //取消按钮字符cancel text : { type : string,default: '取消, //确定按钮文字confirm text : { type : string,default3360 '确定//取消按钮文字颜色cancel text color 3360 { type : string,default3360 ' //确定按钮文字颜色confirm text color 3360 { type 3360 string,data () return ) isshowmodal:false,inputSerialNum: null}}, methods: ) showmodal ) this.is showmodal=handle cancel ((this.is showmodal=false this.$ emit ) onclickcancel ) this.input serial num } }/scriptstylescoped.masking { height 3360100 VH; width: 100vw; 定位:固定; top: 0; left: 0; z-index: 999; }.model-wrap er { width :600 rpx; background-color: #fff; border-radius: 16rpx; 定位:助手; z-index: 1000; top: 50%; left: 50%; 边距-顶部:-161 rpx; 边距左边缘:-300 rpx; box-shadow : # dcdcdc0px0px 20 rpx; }.modal-title {height: 90rpx; line-height: 90rpx; width: 100%; 文本照明3360中心; font-size: 32rpx; 颜色: # 666; }.modal-body { padding :30 rpx 30 rpx 80 rpx 30 rpx; }.btn {width: 300rpx; height: 90rpx; 文本照明3360中心; line-height: 90rpx; font-size: 32rpx; 浮动:左; border-top: 1rpx solid #ddd; }.btn.cancel {width: 299rpx; border-right :1 rpx solid # DCD CDC; (}/style

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。