UNPKG

vue3-focus

Version:
34 lines (28 loc) 525 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var onMounted = function (el, binding) { if (binding.value) { el.focus(); } else { el.blur(); } }; var onUpdated = function (el, binding) { if (binding.modifiers.lazy) { if (Boolean(binding.value) === Boolean(binding.oldValue)) { return; } } if (binding.value) { el.focus(); } else { el.blur(); } }; var vue3Focus = { mounted: onMounted, updated: onUpdated }; exports.vue3Focus = vue3Focus;