eddiemf/vue-affix

Nuxt layout and navigation problem

ambrt opened this issue · 0 comments

ambrt commented

If affix is set in Nuxt layout then affix element works only on first render. When navigation goes to other nuxt page and going back makes affix not work.


<template>
  <section class="section">
    
      <div class="column is-8-tablet is-4-desktop is-10-mobile is-mobile">
        <nuxt id="example-content" />
      </div>
      <div class="column is-3-desktop">
        <affix
          ref="scrollAffixElement"
          class="scrollaffix-sidebar"
          relative-element-selector="#example-content"
          :offset="{ top: 30, bottom: 40 }"
          :scroll-affix="true"
          style="width: 270px"
        >
          <div class="card">
            <header class="card-header">
              <p class="card-header-title heading">Scroll Affix sidebar</p>
            </header>
            <div class="card-content">
              <div class="content">
                ((some content))
              </div>
          </div>
        </affix>
      </div>
     </div>
  </section>
</template>