Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Vue KeepAlive onActivated dose NOT work in storybook decorators #27149

Open
gaokun opened this issue May 15, 2024 · 0 comments
Open

[Bug]: Vue KeepAlive onActivated dose NOT work in storybook decorators #27149

gaokun opened this issue May 15, 2024 · 0 comments

Comments

@gaokun
Copy link

gaokun commented May 15, 2024

Describe the bug

See Reproduce:
As story title said, in 'On Activated Dose Not Invock', onActivated dosen't be called.

export default {
  title: 'Example/Page2',
  component: Page,
  decorators: [
    (story) => ({
      components: { story },
      template: `<KeepAlive><story /></KeepAlive>`, // differece: use story, not Page
    }),
  ],
};

image

But in Keepalive Works Fine, onActivatedis called.

export default {
  title: 'Example/Page',
  component: Page,
  decorators: [
    (story) => ({
      components: { Page },
      template: `<KeepAlive><Page /></KeepAlive>`,
    }),
  ],
};

image

To Reproduce

https://stackblitz.com/edit/github-lfs33b

System

Storybook Environment Info:

  System:
    OS: macOS 14.4.1
    CPU: (12) arm64 Apple M2 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 8.14.1 - ~/.nvm/versions/node/v18.15.0/bin/pnpm <----- active
  Browsers:
    Chrome: 124.0.6367.158
    Safari: 17.4.1

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants