style(flowers): update modal selector to fix style priority issue
修改弹窗样式选择器,提升优先级以覆盖 naive-ui 运行时注入的固定宽度样式,解决 Teleport 弹窗的样式覆盖问题。
This commit is contained in:
@@ -44,8 +44,9 @@ defineExpose({openModal});
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
/* 弹窗被 Teleport 到 body,scoped 样式无法命中;宽度走全局类(约 2/3 屏宽,小屏自适应收缩) */
|
/* 弹窗被 Teleport 到 body,scoped 样式无法命中;naive-ui 运行时注入的 .n-modal.n-dialog 固定 446px
|
||||||
.flower-modal {
|
且晚于打包 CSS 加载,必须用更高优先级选择器才能覆盖(0,3,0 > 0,2,0) */
|
||||||
|
.n-modal.n-dialog.flower-modal {
|
||||||
width: min(66vw, 1280px);
|
width: min(66vw, 1280px);
|
||||||
max-width: 92vw;
|
max-width: 92vw;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user