methods裏面的函數可以互相調用

vue在同一個組件內;

methods中的一個方法調用methods中的另外一個方法

可以在調用的時候  this.handleEdit();

 


  methods: {
      processEdit() { 
                if (this.multipleSelection.length === 0 ) {
                    this.$message( {
                    message: '請選擇要修改的記錄',
                    type: 'warning'
                    } )
                } else if (this.multipleSelection.length > 1 ) {
                    this.$message( {
                    message: '只能選擇1個要修改的記錄',
                    type: 'warning'
                    } )
                } else {
                    var row = this.multipleSelection[0];
                    this.handleEdit(0, row.id);
                }
            },
            handleEdit(index, rowId){
                this.$router.push(
                {
                    path:'/Issuemag/' + this.$route.params.id + '/Issue/modify',
                    query:{rowId:rowId}
                })
            }
            
     },
 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章