Skip to content

preserve state on HMR when multiple components exists in a single file #107

@wxs77577

Description

@wxs77577

Related plugins

Describe the bug

import { defineComponent } from "vue";

export const Test = defineComponent({
  render() {
    return <b>Then change me...</b>;
  },
});

export default defineComponent({
  render() {
    return (
      <div>
        <div>
          <input type="text" placeholder="Type fist..." />
        </div>
        <Test></Test>
      </div>
    );
  },
});

Reproduction

https://stackblitz.com/edit/vitejs-vite-uda5gz?file=src/main.ts

Steps to reproduce

No response

System Info

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Memory: 125.39 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.18.0 - /opt/homebrew/bin/npm
  Browsers:
    Safari: 16.2
  npmPackages:
    @vitejs/plugin-vue: ^4.0.0 => 4.0.0 
    @vitejs/plugin-vue-jsx: ^3.0.0 => 3.0.0 
    vite: ^4.0.0 => 4.1.1

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions