Comments (7)
比如,我在检测到弹窗的表单数据发生修改时, 用户按下esc键,阻止用户关闭弹窗。
from naive-ui.
close-on-esc
https://www.naiveui.com/zh-CN/os-theme/components/modal#controlled.vue
https://www.naiveui.com/zh-CN/os-theme/components/dialog#async.vue
from naive-ui.
close-on-esc 属性只是禁止用户点击 esc 时,关闭弹窗。
需求是:
- close-on-esc 设置为true,允许用户使用esc关闭弹窗, 但程序检测到表单改动时,可以通过on-esc 或者其他事件阻止框架关闭弹窗。
- closable 设置为true,允许用户点击右上角关闭按钮关闭弹窗, 但程序检测到表单改动时,可以通过 某个事件阻止框架关闭弹窗。
上面需求中: 程序检测到表单改动时,可以交给业务框架自己判断, 但上述中的加粗字体有没有办法能实现?
from naive-ui.
通过自定义 close-on-esc
closable
实现业务逻辑
检测表单改动修改对应的值
from naive-ui.
from naive-ui.
比如:
<div id="div1">
<div >
<div >
<div >
<n-button @click="xxx" />
<n-drawer to='#div1' v-model:show="xxxxxx" />
</div>
</div>
</div>
</div>
from naive-ui.
我没具体看,看样子是 Teleport
from naive-ui.
Related Issues (20)
- Select 组件 render-label 和 value-field 同时使用 HOT 2
- The n-date-picker
- 【n-select】可过滤时,展开下拉框后,再次点击输入框无法收回下拉框 HOT 3
- show-menu HOT 3
- 【n-select】能不能手动focus的时候,自动将下拉框打开 HOT 2
- 'pnpm lint' results in TypeError: Converting circular structure to JSON HOT 1
- 希望Code组件可以自定义起始行号
- 500 document is not defined when using n-popover in Nuxt3 HOT 3
- 导出excel乱码 HOT 2
- Select组件支持分页异步加载
- n-upload的照片墙功能
- 【Calendar】日历组件希望可以增加一个右上角切换月份的功能区插槽,或者合并到header插槽
- Tab 初始化时无法填值
- Upload 组件 data 属性为函数时,直接获取形参 file.name 返回 undefined HOT 3
- 支持 DataTable 不同列的 filter 结果取并
- [NDataTable] 在没有数据的情况下,不会有横向滚动条 HOT 2
- 上传组件除了图片类型,其他类型缩略图都不生效 HOT 1
- Drawer组件添加一个lazy属性,指定是否懒挂载 HOT 1
- 建议:n-upload组件添加一个重新上传回调方法
- 需求:为Cascader增加API:render-prefix和render-suffix HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from naive-ui.