Popup can't open after hot reloading with some vue3 script changed on vite
还没有人认领这个 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:
- Create a new vite vue project: npm create vite@latest, choose vue and javascript
- Install framework7: npm i framework7 framework7-vue
- 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')
- 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>
- Run app: npm run dev
- Click the open button, the popup will show, then close it
- Change open to Open, save file, Click the Open button, the popup will show, then close it
- 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
framework7io/framework7 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
framework7io/framework7#4365 · 1 条评论 ·
-
propsHistory 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
framework7io/framework7#4347 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
framework7io/framework7#4222 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
framework7io/framework7#4175 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
framework7io/framework7#3969 · 3 条评论 ·
查看 framework7io/framework7 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
Issue-Bug
难度 2/5 1-3 小时 新手友好度 68/100
sugarlabs/musicblocks#8924 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled 未关闭customer-eng status: needs triage
难度 2/5 1-3 小时 新手友好度 84/100