mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-17 21:33:16 +08:00
14 lines
326 B
JavaScript
14 lines
326 B
JavaScript
|
const callbacks = {
|
||
|
onBeforeElUpdated(from, to) {
|
||
|
// Keep element attributes starting with data-js-
|
||
|
// which we set on the client.
|
||
|
for (const attr of from.attributes) {
|
||
|
if (attr.name.startsWith("data-js-")) {
|
||
|
to.setAttribute(attr.name, attr.value);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export default callbacks;
|