Sign in

Value transfer of Vue + element component

Kris edited in Tue, 10 Jan 2023

When you need to click the list, you need to transfer the data you click to the component. How do you do that

This is the click event, row is the data

<el-table-column label="操作">
          <template slot-scope="scope">
            <el-link :underline="false" @click="rowClick(scope.row)">
              <i class="el-icon-edit" />
              @click="deleteAss(scope.$index, scope.row)"
              <i class="el-icon-delete" />

This is the component: row list = "rowlist" is where I want to pass in

2 Replies
commented on Tue, 10 Jan 2023

Don't the click binding events rowclick and deleteass have row values? In these two functions, assignment this.rowList =Row is OK

commented on Tue, 10 Jan 2023

1. Use method to transfer value

For example, this. $refs ['assign AE ']. Set_ row_ data(data);

2. Assign a value when clicking, and then watch the value in assign AE.

3. Another way is to use vuex state management.