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

[NModal] 受控模式下触发Vue错误 #5971

Closed
5 tasks done
neko-para opened this issue May 22, 2024 · 2 comments
Closed
5 tasks done

[NModal] 受控模式下触发Vue错误 #5971

neko-para opened this issue May 22, 2024 · 2 comments
Labels
untriaged need to sort

Comments

@neko-para
Copy link

描述错误

按照复现步骤,NModal的show关联的ref变量在被修改(无论是在setup中直接修改或是被v-modal修改)时,会触发[Vue warn] Set operation on key "_ctx" failed: target is readonly., 出错位置在设置ref变量的地方。
image

复现步骤

pnpm install
pnpm run dev
点击modal的遮罩,等待其自动重新出现
查看控制台

尝试了在空项目中复现,却没有复现出来,只好提供完整项目了(
已经配置过项目,使得模态框能立即触发

最小复现链接

https://github.com/neko-para/maa-support/tree/naive-issue

系统信息

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 7735H with Radeon Graphics
    Memory: 13.93 GB / 27.69 GB
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.0.2 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.22621.3527

使用的包管理器

pnpm

验证

@neko-para neko-para added the untriaged need to sort label May 22, 2024
@jahnli
Copy link
Collaborator

jahnli commented May 23, 2024

我这边没有复现,这似乎与 naiveUI 无关
image

@jahnli jahnli closed this as completed May 23, 2024
@qp91abc1234
Copy link

qp91abc1234 commented Jun 7, 2024

试了下 n-drawer,也会出现

<script setup lang="ts">
import { ref } from 'vue'

const active = ref(false)
function activate() {
  active.value = true
}
</script>

<template>
  <n-button @click="activate()">
    右
  </n-button>
  <n-drawer v-model:show="active" :width="502" placement="right">
    <n-drawer-content title="斯通纳">
      《斯通纳》是美国作家约翰·威廉姆斯在 1965 年出版的小说。
    </n-drawer-content>
  </n-drawer>
</template>

<style lang="scss" scoped>
</style>

"vue": "^3.4.21"
"@vitejs/plugin-vue": "^5.0.4",
"vite": "^5.2.0",
"vue-tsc": "^2.0.6"

vue 更新到 3.4.27 就无了😀

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

No branches or pull requests

3 participants