Skip to content

feat(popeditor): [popeditor] add attribute lock-scroll #3490

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

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/sites/demos/apis/popeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,20 @@ export default {
mode: ['pc'],
pcDemo: 'title'
},
{
name: 'lock-scroll',
type: 'boolean',
defaultValue: 'true',
desc: {
'zh-CN': '设置弹出面板的锁定滚动',
'en-US': 'Set the lock scroll of the pop-up panel.'
},
meta: {
stable: '3.24.0'
},
mode: ['pc'],
pcDemo: 'condition-layout'
},
{
name: 'trigger',
type: "'default' | 'cell' | 'row'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
text-field="name"
value-field="id"
:conditions="conditions"
:lock-scroll="false"
></tiny-popeditor>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ test('PopEditor 布局与配置', async ({ page }) => {
const rightLayout = dialogBox.locator('.tiny-popeditor-body__right')

await textBox.click()
await expect(page.locator('body')).not.toHaveClass(/dialog-box__scroll-lock/)
await expect(dialogBox).toBeVisible()
await expect(leftLayout).toBeVisible()
await expect(rightLayout).toBeVisible()
Expand Down
1 change: 1 addition & 0 deletions examples/sites/demos/pc/app/popeditor/condition-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
text-field="name"
value-field="id"
:conditions="conditions"
:lock-scroll="false"
></tiny-popeditor>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/popeditor/webdoc/popeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export default {
},
desc: {
'zh-CN':
'<p>通过 <code>conditions</code> 项目里属性里的 <code>span</code> 配置栅格,<code>labelWidth</code> 配置 label 宽度,<code>component</code>配置自定义组件,并通过 <code>attrs</code> 配置组件属性。</p>',
'<p>通过 <code>conditions</code> 项目里属性里的 <code>span</code> 配置栅格,<code>labelWidth</code> 配置 label 宽度,<code>component</code>配置自定义组件,并通过 <code>attrs</code> 配置组件属性。<code>lock-scroll</code> 配置弹出窗口时是否禁用滚动条。</p>',
'en-US':
'<p>Set <code>span</code> in the attributes of the <code>condition</code> project to configure the grid and <code>labelWidth</code> to configure the label width. <code>component</code>Configure custom components and set component attributes through <code>attrs</code></p>'
'<p>Set <code>span</code> in the attributes of the <code>condition</code> project to configure the grid and <code>labelWidth</code> to configure the label width. <code>component</code>Configure custom components and set component attributes through <code>attrs</code>.<code>lock-scroll</code>Configure whether to disable the scrollbar when a pop-up window appears.</p>'
},
codeFiles: ['condition-layout.vue']
},
Expand Down
4 changes: 4 additions & 0 deletions packages/vue/src/popeditor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export const popeditorProps = {
type: Boolean,
default: true
},
lockScroll: {
type: Boolean,
default: true
},
placement: {
type: String,
default: 'bottom-start'
Expand Down
2 changes: 2 additions & 0 deletions packages/vue/src/popeditor/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
@closed="state.showContent = false"
:before-close="handleBeforeClose"
:dialog-class="dialogClass"
:lock-scroll="lockScroll"
>
<template v-if="state.showContent">
<div class="tiny-popeditor-top" v-if="state.conditions.length && popseletor === 'grid'">
Expand Down Expand Up @@ -394,6 +395,7 @@ export default defineComponent({
'dialogClass',
'tabindex',
'draggable',
'lockScroll',
'placement',
'popperAppendToBody',
'suggest',
Expand Down
Loading