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

No hot update, refresh the entire page #2778

Closed
meikang123 opened this issue Dec 9, 2020 · 1 comment
Closed

No hot update, refresh the entire page #2778

meikang123 opened this issue Dec 9, 2020 · 1 comment

Comments

@meikang123
Copy link

Version

3.0.4

Reproduction link

https://github.com/meikang123/vue3.0.git

Steps to reproduce

hot update

<template>
  <section class="section">
    <h2>不会刷新页面</h2>
    <button @click="change">点击增加状态值</button>
    <p>改变这个元素内容、保存-状态不会丢失、内容:4567</p>
    <p>状态值:{{ count }}</p>
  </section>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';

export default defineComponent({
  name: 'App',

  setup() {
    const count = ref(0);

    const change = () => {
      count.value  = 1;
    };

    return {
      count,
      change
    };
  }
});
</script>

yarn dev:index

no hot update

import { defineComponent, ref } from 'vue';

export default defineComponent({
  name: 'App',

  setup() {
    const count = ref(0);

    const change = () => {
      count.value  = 1;
    };

    return () => (
      <section class="section">
        <h2>不管组件多深层都会刷新页面</h2>
        <button onClick={change}>点击增加状态值</button>
        <p>改变这个元素内容、保存状态会丢失、内容:121</p>
        <p>状态值:{ count.value }</p>
      </section>
    );
  }
});

yarn dev:main

What is expected?

hot update

What is actually happening?

no hot update


vue devtools 无法审查第二种的数据

@posva
Copy link
Member

posva commented Dec 9, 2020

Read the link I sent you at #2776 (comment):

  • a minimal reproduction, no TS, no vant, no class component, etc
  • Write it in English so everybody can understand

@posva posva closed this as completed Dec 9, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants