Giter VIP home page Giter VIP logo

Comments (4)

TerryZ avatar TerryZ commented on August 26, 2024

这个是设计上的取舍了,我猜想你的场景应该是

弹窗操作完成后,返回数据给父组件,父组件接收到数据后,执行相关数据操作,数据操作完成后才关闭窗口

其实弹窗应当与相关业务场景进行解耦,弹窗/选择器只负责选择数据及反馈,至于后续的内容与弹窗没有关系

以目前的功能,当执行 emit('close') 后,弹窗是一定会关闭的,没有其他可选项,如果一定要完成你的需求,我有两个建议

  1. 使用 Vuex 处理数据传递,父组件中监听 state,弹窗中 commit 数据,不太优雅,但能实现你的功能
  2. 考虑把数据操作的相关事务放在弹窗中处理

from v-dialogs.

chanyipiaomiao avatar chanyipiaomiao commented on August 26, 2024

目前就是这种场景,有时候比如一个注册表单,如果用户名存在,那我就换一个用户名,如果自动关闭了,那信息就得重新输入一遍

from v-dialogs.

TerryZ avatar TerryZ commented on August 26, 2024

用户名在失去焦点的时候就立即做有效性验证

from v-dialogs.

chanyipiaomiao avatar chanyipiaomiao commented on August 26, 2024

好吧。

from v-dialogs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.