工作284:理解繫結邏輯

小歌謠(公眾號同名)發表於2020-12-28
  <custom-table    v-loading="loading"
                       element-loading-text="拼命載入中"
                       element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" @size-changes="list"  @pagination-change="list" :data="tableData" :columns="columns" :pagination="pagination">
        <template v-slot:action>
          <el-table-column fixed="right" label="操作">
            <template slot-scope="scope">
              <el-button @click="handleEdit(scope.row)" type="text">
                編輯
              </el-button>
              <el-button type="text" @click="deleteRecord(scope.row)">
                刪除
              </el-button>
              <!--繫結資料使用當前的id-->
              <el-button type="text" @click="BindAccount(scope.row)">
                繫結
              </el-button>
            </template>
          </el-table-column>
        </template>
      </custom-table>

第二步
判斷賬號是否繫結

  /*判斷賬號是否繫結的資料邏輯*/
    BindAccount(record) {
      this.dialogVisible = true
      console.log(record)
      getAction("/account/ff_account_list",{content_type:record.content_type}).then(res => {
        /*通過account_id接收*/
        this.account_id = record.id
        this.BindData = res.data.data
        this.RomoteData=res.data.remoteAccountIds

      })
    },

相關文章