Closed meijintao233 closed 3 years ago
// tippy.js var tippyModifier = { name: '$$tippy', enabled: true, phase: 'beforeWrite', requires: ['computeStyles'], fn: function fn(_ref2) { var state = _ref2.state; if (getIsDefaultRenderFn()) { var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box; ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) { if (attr === 'placement') { box.setAttribute('data-placement', state.placement); } else { if (state.attributes.popper["data-popper-" + attr]) { box.setAttribute("data-" + attr, ''); } else { box.removeAttribute("data-" + attr); } } }); state.attributes.popper = {}; } }
when popover update its position, the code would be excuted,but I can not get current latest state
I'm not sure what's being asked exactly, all popper modifiers allow you to hook into the current state, there's no final update hook callback though but you can use an afterWrite modifier phase modifier
afterWrite
Problem
when popover update its position, the code would be excuted,but I can not get current latest state