NEZ-1726 feat: loading 动画优化 添加 unbind事件

This commit is contained in:
zhangyu
2022-03-25 14:43:36 +08:00
parent 4c64c41342
commit 1588b9328f

View File

@@ -102,10 +102,9 @@ export const myLoading = {
bind: myLoadingFunction, bind: myLoadingFunction,
update: myLoadingFunctionUpdate, update: myLoadingFunctionUpdate,
unbind: function (el, binding) { unbind: function (el, binding) {
const className = binding.arg || 'bars1' const dsBox = el.getElementsByClassName('my-loading-box')[0]
const ds = el.getElementsByClassName(className)[0] if (dsBox) {
if (ds) { el.removeChild(dsBox)
el.removeChild(ds)
} }
} }
} }