When you use datatables, to set the callback function in vue, you use to add elements dynamically, and the events bound on the elements are undefined when called. How to solve this problem?

{"mData": "sn","bSortable": false,
    "createdCell": function (nTd, sData, oData, iRow, iCol) {
          return "<a href="-sharp" onclick="edit_model(1111)"></a>";//
          edit_model();//
          // that.$router.push({ path: "demo", query: { plan: "private" }})
    }
}

The definitions of

functions are all defined in mounted. The elements dynamically added in datatables"s createdCell callback function bind events, but when the event is called, the prompt function is not defined, but calling the function directly in the callback function can be called directly

.
Menu