uni-app:showModal中实现弹窗中文本框输入

效果

代码

<template>
  <view>
    <!-- 显示弹窗的按钮 -->
    <button @click="showInputDialog">显示弹窗</button>
  </view>
</template>

<script>
export default {
  methods: {
    showInputDialog() {
      uni.showModal({
        title: '请完成数据填写',
        content: '',
        editable:true,//是否显示输入框
		placeholderText:'请输入SN号',//输入框提示内容
        confirmText: '确认',
        cancelText: '取消',
        success: (res) => {
          if (res.confirm) {
            console.log('输入的内容:', res.content);
          }
        } 
      });
    }
  }
};
</script>

官方文档

uni.showToast(OBJECT) | uni-app官网 (dcloud.net.cn)

猜你喜欢

转载自blog.csdn.net/weixin_46001736/article/details/133384754