How to use the onUnmounted function from vue

Find comprehensive JavaScript vue.onUnmounted code examples handpicked from public code repositorys.

101
102
103
104
105
106
107
108
109
110
if (depth != null) {
  var removeGuard = router.beforeEach(function (to, from, next) {
    return fn(to, from, depth) ? guard(to, from, next) : next()
  })

  vue.onUnmounted(removeGuard)
  return removeGuard
}

return noop
fork icon0
star icon0
watch icon1

+ 4 other calls in file

1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849


function registerGuard(record, name, guard) {
    const removeFromList = () => {
        record[name].delete(guard);
    };
    vue.onUnmounted(removeFromList);
    vue.onDeactivated(removeFromList);
    vue.onActivated(() => {
        record[name].add(guard);
    });
fork icon0
star icon0
watch icon1

+ 11 other calls in file

844
845
846
847
848
849
850
851
852
853
// TODO: optimize initial compute (once)
const meta = this.target.addSource(metadata, resolveContext, true);
const onRemoved = (removeGuard) => metaGuards.removed.push(removeGuard);
const unmount = (ignoreGuards) => this.unmount(!!ignoreGuards, meta, metaGuards, vm);
if (vm) {
    vue.onUnmounted(unmount);
}
return {
    meta,
    onRemoved,
fork icon0
star icon0
watch icon1

+ 3 other calls in file