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

[Component] [input] v-show使用初始化变量控制显示或隐藏时不起作用 #15864

Closed
wangnamin opened this issue Feb 18, 2024 · 8 comments · Fixed by #15865
Closed
Labels
Component::Input 🔨 Vue issue Issue caused by Vue. Can't do anything

Comments

@wangnamin
Copy link

Bug Type: Component

Environment

  • Vue Version: 3.4.19
  • Element Plus Version: 2.5.5
  • Browser / OS: Chrome版本 121.0.6167.185(正式版本) (64 位)
  • Build Tool: Webpack

Reproduction

Related Component

  • el-input

Reproduction Link

Element Plus Playground

Steps to reproduce

点击Playground链接可以直接查看效果

What is Expected?

初始化时v-show的值为false,input控件应该是不显示的

What is actually happening?

【初始化】时v-show的值为false,但是input控件还是显示出来了

Additional comments

在示例中还放置了一个el-switch作为对比,是正常的,只有el-input有问题

@nova1751
Copy link
Contributor

image 我这里都不见了呀

@wangnamin
Copy link
Author

我这里是这样的。
image

@btea
Copy link
Collaborator

btea commented Feb 18, 2024

似乎是vue的问题,切换到 3.4.17就可以了。

rel vuejs/core#10338

@chenxch chenxch added the 🔨 Vue issue Issue caused by Vue. Can't do anything label Feb 18, 2024
@wangnamin
Copy link
Author

似乎是vue的问题,切换到 3.4.17就可以了。

vue中使用原生的示例没问题,就是el-input不行,还请大神看下如何解决

<script setup>
import { ref } from 'vue'

const msg = ref('Hello World!')
const bool1 = ref(false)
</script>

<template>
  <h1>{{ msg }}</h1>{{bool1}}
  <input v-model="bool1" type="checkbox" />
  <input v-show="bool1" v-model="msg" />
</template>

image

@chenxch
Copy link
Member

chenxch commented Feb 18, 2024

@chenxch
Copy link
Member

chenxch commented Feb 18, 2024

@wangnamin 看来3.4.19都还没修复, 考虑降级锁定到3.4.15

@wangnamin
Copy link
Author

@wangnamin 看来3.4.19都还没修复, 考虑降级锁定到3.4.15

好的

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。

@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component::Input 🔨 Vue issue Issue caused by Vue. Can't do anything
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants