Layui的layer和vue一起使用,弹框中的form表单控件用v-modal进行双向数据绑定无效的解决方法

  1. 给input绑定@change方法,在new Vue()的method中使用e.target.value获取值并赋值给state中的全局变量。在layer使用全局变量获取即可。
    <input type="text" @change="changeText" />
    
    method:{
    	changeText:function(e){
    		this.text=e.target.value
    }
    }
    
  2. 在Success函数里写vue代码。
发布了258 篇原创文章 · 获赞 21 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/wsln_123456/article/details/104900463