Comments (10)
我正在准备提一个pr,我先考虑下修改方案
from element-plus.
目前部分组件的zIndex都是初始化后固定的,或许可以考虑将其改为计算属性。
from element-plus.
我正在准备提一个pr,我先考虑下修改方案
可以参考部分组件已经实现的方案
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前
const zIndex = !isUndefined(props.zIndex)
? computed(() => props.zIndex)
: ref(nextZIndex())
我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前 const zIndex = !isUndefined(props.zIndex) ? computed(() => props.zIndex) : ref(nextZIndex())我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
这个写法是存在问题的,如果初始化zIndex是undefined,你后续怎么变更都是使用nextZIndex返回的值,完全可以用计算属性直接解决,建议参考tour组件中的处理方案。
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前 const zIndex = !isUndefined(props.zIndex) ? computed(() => props.zIndex) : ref(nextZIndex())我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
这个写法是存在问题的,如果初始化zIndex是undefined,你后续怎么变更都是使用nextZIndex返回的值,完全可以用计算属性直接解决,建议参考tour组件中的处理方案。
确实是存在问题得
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前 const zIndex = !isUndefined(props.zIndex) ? computed(() => props.zIndex) : ref(nextZIndex())我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
这个写法是存在问题的,如果初始化zIndex是undefined,你后续怎么变更都是使用nextZIndex返回的值,完全可以用计算属性直接解决,建议参考tour组件中的处理方案。
确实是存在问题得
OK,感谢,我再修改
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前 const zIndex = !isUndefined(props.zIndex) ? computed(() => props.zIndex) : ref(nextZIndex())我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
这个写法是存在问题的,如果初始化zIndex是undefined,你后续怎么变更都是使用nextZIndex返回的值,完全可以用计算属性直接解决,建议参考tour组件中的处理方案。
pr构建报错,zIndex已经是计算属性了,我是否可以吧 zIndex.value = isUndefined(props.zIndex) ? nextZIndex() : zIndex.value++
删除
fix(components): dialog zIndex 修改不生效
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前 const zIndex = !isUndefined(props.zIndex) ? computed(() => props.zIndex) : ref(nextZIndex())我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
可不可以这样改: const zIndex = computed(() => props.zIndex ?? nextZIndex())
from element-plus.
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前 const zIndex = !isUndefined(props.zIndex) ? computed(() => props.zIndex) : ref(nextZIndex())我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个
可不可以这样改: const zIndex = computed(() => props.zIndex ?? nextZIndex())
不可以,,会陷入 无限递归中,我一开始就这么改的
from element-plus.
Related Issues (20)
- [Component] [tree-select] 开启 `allow-create` 时样式错乱
- [Component] [All] Failed to resolve component: el-button If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. HOT 1
- [Component] [select]: select 配置可清空功能,清空后值变成undefined,类型发生变化 HOT 7
- [Component] [row, col] 当横向渲染分辨率设置为767px时el-col组件布局失去响应式。
- [IDEA] more Types HOT 1
- [Feature Request] More types HOT 5
- [tree-select] el-tree-select
- [Component] [select, select-v2] select中添加了tagTooltip但popper-options属性不能定义导致tagTooltip显示是会被盖住
- [Component] [input] focus事件里面执行blur,会再次出发focus事件 HOT 2
- [Component] [tree] Tree组件 setCheckedKeys接口中leafOnly参数设置无效
- [Component] [tree] 官网上 el-tree 自定义节点类名这个例子好像有问题,叶子节点横向显示有问题 HOT 2
- [Component] [dialog] edge浏览器使用 el-dialog 中嵌套 video 标签,导致video更多选项不显示 HOT 6
- [Component] [button] Button link variant has invalid color HOT 13
- [Component] [tree] 使用tree 拖动元素时候,如果超出了tree的可操作区域就不应该拖动成功,现在可以拖动成功
- [Component] [All] 在谷歌21版本的浏览器中,el-input输入中文自动带入拼音 HOT 3
- [Component] [table-v2] Component] [table-v2] el-table-v2 设置columns的fixed属性后,如果row-key使用数字或者数字开头的字符串,onRowHovered 事件报错
- [Component] [tree-select] TreeSelect 在文档中的分类应当为 Form 表单组件
- [Component] [table, table-column] 当表格中所有列都是fixed时,虽然内容未超出,但表格仍然会有横向滚动
- [Style] [tabs, tab-pane] 给el-tabs__item的style添加 padding-lert right !important 导致只有一个ElTabPane的时候下划线长度计算错误 HOT 1
- [Component] [date-picker] el-date-picker的type为datetimerange时,选择同一天,下拉面板左右两边显示两个相同的月份
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 element-plus.