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
		}
    }
}

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM