Skip to content

Commit 49bdd9b

Browse files
committed
feat(popeditor): [popeditor] add attribute lock-scroll
1 parent 1e33249 commit 49bdd9b

File tree

7 files changed

+25
-2
lines changed

7 files changed

+25
-2
lines changed

examples/sites/demos/apis/popeditor.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,20 @@ export default {
344344
mode: ['pc'],
345345
pcDemo: 'title'
346346
},
347+
{
348+
name: 'lock-scroll',
349+
type: 'boolean',
350+
defaultValue: 'true',
351+
desc: {
352+
'zh-CN': '设置弹出面板的锁定滚动',
353+
'en-US': 'Set the lock scroll of the pop-up panel.'
354+
},
355+
meta: {
356+
stable: '3.24.0'
357+
},
358+
mode: ['pc'],
359+
pcDemo: 'condition-layout'
360+
},
347361
{
348362
name: 'trigger',
349363
type: "'default' | 'cell' | 'row'",

examples/sites/demos/pc/app/popeditor/condition-layout-composition-api.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
text-field="name"
99
value-field="id"
1010
:conditions="conditions"
11+
:lock-scroll="false"
1112
></tiny-popeditor>
1213
</template>
1314

examples/sites/demos/pc/app/popeditor/condition-layout.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ test('PopEditor 布局与配置', async ({ page }) => {
1111
const rightLayout = dialogBox.locator('.tiny-popeditor-body__right')
1212

1313
await textBox.click()
14+
await expect(page.locator('body')).not.toHaveClass(/dialog-box__scroll-lock/)
1415
await expect(dialogBox).toBeVisible()
1516
await expect(leftLayout).toBeVisible()
1617
await expect(rightLayout).toBeVisible()

examples/sites/demos/pc/app/popeditor/condition-layout.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
text-field="name"
99
value-field="id"
1010
:conditions="conditions"
11+
:lock-scroll="false"
1112
></tiny-popeditor>
1213
</template>
1314

examples/sites/demos/pc/app/popeditor/webdoc/popeditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export default {
3838
},
3939
desc: {
4040
'zh-CN':
41-
'<p>通过 <code>conditions</code> 项目里属性里的 <code>span</code> 配置栅格,<code>labelWidth</code> 配置 label 宽度,<code>component</code>配置自定义组件,并通过 <code>attrs</code> 配置组件属性。</p>',
41+
'<p>通过 <code>conditions</code> 项目里属性里的 <code>span</code> 配置栅格,<code>labelWidth</code> 配置 label 宽度,<code>component</code>配置自定义组件,并通过 <code>attrs</code> 配置组件属性。<code>lock-scroll</code> 配置弹出窗口时是否禁用滚动条。</p>',
4242
'en-US':
43-
'<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>'
43+
'<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>'
4444
},
4545
codeFiles: ['condition-layout.vue']
4646
},

packages/vue/src/popeditor/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ export const popeditorProps = {
183183
type: Boolean,
184184
default: true
185185
},
186+
lockScroll: {
187+
type: Boolean,
188+
default: true
189+
},
186190
placement: {
187191
type: String,
188192
default: 'bottom-start'

packages/vue/src/popeditor/src/pc.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
@closed="state.showContent = false"
9898
:before-close="handleBeforeClose"
9999
:dialog-class="dialogClass"
100+
:lock-scroll="lockScroll"
100101
>
101102
<template v-if="state.showContent">
102103
<div class="tiny-popeditor-top" v-if="state.conditions.length && popseletor === 'grid'">
@@ -394,6 +395,7 @@ export default defineComponent({
394395
'dialogClass',
395396
'tabindex',
396397
'draggable',
398+
'lockScroll',
397399
'placement',
398400
'popperAppendToBody',
399401
'suggest',

0 commit comments

Comments
 (0)