mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
feat(content): add parts support for background, scroll (#20929)
This commit is contained in:
@ -9,6 +9,9 @@ import { createColorClasses, hostContext } from '../../utils/theme';
|
||||
/**
|
||||
* @slot - Content is placed in the scrollable area if provided without a slot.
|
||||
* @slot fixed - Should be used for fixed content that should not scroll.
|
||||
*
|
||||
* @part background - The background of the content.
|
||||
* @part scroll - The scrollable container of the content.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-content',
|
||||
@ -321,7 +324,7 @@ export class Content implements ComponentInterface {
|
||||
'--offset-bottom': `${this.cBottom}px`,
|
||||
}}
|
||||
>
|
||||
<div id="background-content"></div>
|
||||
<div id="background-content" part="background"></div>
|
||||
<main
|
||||
class={{
|
||||
'inner-scroll': true,
|
||||
@ -331,6 +334,7 @@ export class Content implements ComponentInterface {
|
||||
}}
|
||||
ref={el => this.scrollEl = el!}
|
||||
onScroll={(this.scrollEvents) ? ev => this.onScroll(ev) : undefined}
|
||||
part="scroll"
|
||||
>
|
||||
<slot></slot>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user