mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(): remove [main] from split-pane (#19511)
This commit is contained in:
committed by
Brandy Carney
parent
e665d38d23
commit
ac4f254a4f
4
core/src/components.d.ts
vendored
4
core/src/components.d.ts
vendored
@@ -2457,7 +2457,7 @@ export namespace Components {
|
||||
}
|
||||
interface IonSplitPane {
|
||||
/**
|
||||
* The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane.
|
||||
* The content `id` of the split-pane's main content.
|
||||
*/
|
||||
'contentId'?: string;
|
||||
/**
|
||||
@@ -5706,7 +5706,7 @@ declare namespace LocalJSX {
|
||||
}
|
||||
interface IonSplitPane {
|
||||
/**
|
||||
* The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane.
|
||||
* The content `id` of the split-pane's main content.
|
||||
*/
|
||||
'contentId'?: string;
|
||||
/**
|
||||
|
||||
@@ -133,11 +133,11 @@ export const SplitPlaneExample: React.SFC<{}> = () => (
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Attribute | Description | Type | Default |
|
||||
| ----------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------- |
|
||||
| `contentId` | `content-id` | The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane. | `string \| undefined` | `undefined` |
|
||||
| `disabled` | `disabled` | If `true`, the split pane will be hidden. | `boolean` | `false` |
|
||||
| `when` | `when` | When the split-pane should be shown. Can be a CSS media query expression, or a shortcut expression. Can also be a boolean expression. | `boolean \| string` | `QUERY['lg']` |
|
||||
| Property | Attribute | Description | Type | Default |
|
||||
| ----------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------- |
|
||||
| `contentId` | `content-id` | The content `id` of the split-pane's main content. | `string \| undefined` | `undefined` |
|
||||
| `disabled` | `disabled` | If `true`, the split pane will be hidden. | `boolean` | `false` |
|
||||
| `when` | `when` | When the split-pane should be shown. Can be a CSS media query expression, or a shortcut expression. Can also be a boolean expression. | `boolean \| string` | `QUERY['lg']` |
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
@@ -29,8 +29,6 @@ export class SplitPane implements ComponentInterface {
|
||||
|
||||
/**
|
||||
* The content `id` of the split-pane's main content.
|
||||
* This property can be used instead of the `[main]` attribute to select the `main`
|
||||
* content of the split-pane.
|
||||
*/
|
||||
@Prop() contentId?: string;
|
||||
|
||||
@@ -151,7 +149,7 @@ AFTER:
|
||||
let foundMain = false;
|
||||
for (let i = 0; i < nu; i++) {
|
||||
const child = children[i] as HTMLElement;
|
||||
const isMain = contentId !== undefined ? child.id === contentId : child.hasAttribute('main');
|
||||
const isMain = contentId !== undefined && child.id === contentId;
|
||||
if (isMain) {
|
||||
if (foundMain) {
|
||||
console.warn('split pane cannot have more than one main node');
|
||||
|
||||
Reference in New Issue
Block a user