zoukankan      html  css  js  c++  java
  • vue中msgbox的使用;如何在msgbox中新增一个输入框组件传值给后台

    export default {
        data () {
          return {
            endReason: ''
          }
        },
        methods: {
    		endFlw(item) {
    			const h = this.$createElement;
    			this.$msgbox({
    			  title: '消息',
    			  message: h('p', null, [
    				h('span', null, '确认结束流程号为:'),
    				h('i', { style: 'color:red' }, '+item.flwNo+'),
    	               h('span', null, '的流程吗?结束原因'),
    				h('i', { style: 'color:red' }, '(必填)'),
    				h('span', null, ':'),
    				h("div", null, [
    				  h("input", {
    					style: {
    					  marginTop: "20px"
    					},
    					attrs: { value: this.endReason, id:"hinput"},
    					on: {input: this.handleClick}
    				  })
    				])
    			  ]),
    			  showCancelButton: true,
    			  confirmButtonText: '确定',
    			  cancelButtonText: '取消',
    			  beforeClose: (action, instance, done) => {
    				if (action === 'confirm') {
    				  // 这里可以通过this.endReason获取input框的输入值传入后台了
    				} else {
    				  ....
    				}
    			  }
    			}).then(action => {
    			  this.$message({
    				type: 'info',
    				message: 'action: ' + action
    			  });
    			});
    		},
    	  
    		handleClick() {
    			var a=document.getElementById("hinput").value;
    			this.endReason = a
    		}
        }
    }
    

      

  • 相关阅读:
    可怕的用户习惯
    编程5年了,养成的臭脾气
    从5楼到9楼
    Google(10|9)大黄金定律
    如果我们也有Lab
    心情有点烦乱
    [zz]万能类型boost::any
    [zz]GDB调试精粹及使用实例
    [zz]sqlalchemy使用
    sqlalchemy实际使用
  • 原文地址:https://www.cnblogs.com/jetqiu/p/13081935.html
Copyright © 2011-2022 走看看