Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Popup can't open after hot reloading with some vue3 script changed on vite

未关闭
#4,341 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
javascript, vite
领域
frontend

调研方向

从 main.js 中的 Framework7 设置以及 App.vue 中的 popup 状态和 handleOpen 代码开始。在复现的 Vite Vue 项目中运行 npm run dev,触发所描述的 script 热重载,并验证之后 popup 仍然可以打开,而无需刷新浏览器。

由索引模型根据 Issue 内容生成。

描述

  • Framework7 version: 8.3.4
  • Vue.js version: 3.5.24
  • Platform and Target: win11 chrome browser
  • Live Link or CodeSandbox: none
Describe the bug

Popup can't open after hot reloading with some script changed on vite, refreshing the website will help.
PS: Changing some html may not make popup not function.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new vite vue project: npm create vite@latest, choose vue and javascript
  2. Install framework7: npm i framework7 framework7-vue
  3. In main.js
import { createApp } from 'vue'
import './style.css'

import Framework7 from 'framework7/lite-bundle'
import Framework7Vue, { registerComponents } from 'framework7-vue/bundle'
import 'framework7/css/bundle'
Framework7.use(Framework7Vue)

import App from './App.vue'

const app = createApp(App)
registerComponents(app)
app.mount('#app')

  1. In App.vue
<script setup>
import { reactive } from 'vue'
const f7params = {
  name: 'My App',
  theme: 'md',
  version: '1.0.0',
}

const edit = reactive({
  popupOpened: false,
})

const handleOpen = () => {
  edit.popupOpened = true
  console.log('handleOpen')
}
</script>

<template>
  <div id="app">
    <f7-app v-bind="f7params">
      <f7-page>
        <f7-block>
          <f7-button fill round style="width: 50%;" @click="handleOpen">open</f7-button>
        </f7-block>
        <f7-popup v-model:opened="edit.popupOpened" :closeByBackdropClick="false">
          <f7-page>
            <f7-navbar title="Edit">
              <f7-nav-right>
                <f7-link popup-close>Confirm</f7-link>
              </f7-nav-right>
            </f7-navbar>
          </f7-page>
        </f7-popup>
      </f7-page>
    </f7-app>
  </div>
</template>

<style>
body, html, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  outline: none;
}
</style>
  1. Run app: npm run dev
  2. Click the open button, the popup will show, then close it
  3. Change open to Open, save file, Click the Open button, the popup will show, then close it
  4. Change log in handleOpen, like
const handleOpen = () => {
  edit.popupOpened = true
  console.log('handleOpen1')
}

Click the Open button, nothing happened.

Expected behavior

After changing script and save, a hot-reload invoked, popup can still be opened.

Actual Behavior

After changing script and save, a hot-reload invoked, popup can't be opened, unless you refresh the browser.

主要语言
JavaScript
星标
18.8k
派生
3.2k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

framework7io/framework7 的其他 Issue

查看 framework7io/framework7 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。