Skip to content

Commit 44a8efc

Browse files
committed
Merge branch 'main' of github.com:ionic-team/ionic-docs
# Conflicts: # docs/core-concepts/fundamentals.md
2 parents 2881413 + 5034dee commit 44a8efc

File tree

865 files changed

+4294
-10327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

865 files changed

+4294
-10327
lines changed

_templates/playground/new/vue.md.ejs.t

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@ to: "<%= `static/usage/v${version}/${name}/${path}/vue.md` %>"
77
<<%= component %>></<%= component %>>
88
</template>
99

10-
<script lang="ts">
10+
<script setup lang="ts">
1111
import { <%= pascalComponent %> } from '@ionic/vue';
12-
import { defineComponent } from 'vue';
13-
14-
export default defineComponent({
15-
components: {
16-
<%= pascalComponent %>,
17-
},
18-
});
1912
</script>
2013
<% if (css){ -%>
2114

docs/api/tab-bar.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,9 @@ export const TabBarExample: React.FC = () => (
130130
</ion-tabs>
131131
</template>
132132

133-
<script>
133+
<script setup lang="ts">
134134
import { IonIcon, IonTabBar, IonTabButton, IonTabs } from '@ionic/vue';
135135
import { call, person, settings } from 'ionicons/icons';
136-
import { defineComponent } from 'vue';
137-
138-
export default defineComponent({
139-
components: { IonIcon, IonTabBar, IonTabButton, IonTabs },
140-
setup() {
141-
return { call, person, settings }
142-
}
143-
});
144136
</script>
145137
```
146138

@@ -176,4 +168,4 @@ import InsideTabBar from '@site/static/usage/v8/badge/inside-tab-bar/index.md';
176168
<CustomProps />
177169

178170
## Slots
179-
<Slots />
171+
<Slots />

docs/api/tab-button.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import CustomProps from '@ionic-internal/component-api/v8/tab-button/custom-prop
1212
import Slots from '@ionic-internal/component-api/v8/tab-button/slots.md';
1313

1414

15-
15+
1616
import EncapsulationPill from '@components/page/api/EncapsulationPill';
1717

1818
<EncapsulationPill type="shadow" />
@@ -166,7 +166,7 @@ export const TabButtonExample: React.FC = () => (
166166
</ion-tab-button>
167167

168168
<ion-tab-button tab="speakers" href="/tabs/speakers">
169-
<ion-icon :icon="person-circle" aria-hidden="true"></ion-icon>
169+
<ion-icon :icon="personCircle" aria-hidden="true"></ion-icon>
170170
<ion-label>Speakers</ion-label>
171171
</ion-tab-button>
172172

@@ -183,29 +183,15 @@ export const TabButtonExample: React.FC = () => (
183183
</ion-tabs>
184184
</template>
185185

186-
<script>
187-
import {
188-
IonIcon,
189-
IonLabel,
190-
IonTabBar,
191-
IonTabButton,
186+
<script setup lang="ts">
187+
import {
188+
IonIcon,
189+
IonLabel,
190+
IonTabBar,
191+
IonTabButton,
192192
IonTabs
193193
} from '@ionic/vue';
194194
import { calendar, informationCircle, map, personCircle } from 'ionicons/icons';
195-
import { defineComponent } from 'vue';
196-
197-
export default defineComponent({
198-
components: {
199-
IonIcon,
200-
IonLabel,
201-
IonTabBar,
202-
IonTabButton,
203-
IonTabs
204-
},
205-
setup() {
206-
return { calendar, informationCircle, map, personCircle }
207-
}
208-
});
209195
</script>
210196
```
211197

docs/core-concepts/fundamentals.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,30 @@ Ionic Framework は<a href="https://developer.mozilla.org/en-US/docs/Web/CSS" ta
5151

5252
多くの Ionic コンポーネントは [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) を使用して、コンポーネントの重要な状態変化を開発者に通知します。例えば、 `ion-datetime` コンポーネントは、選択された日付が変更されると `ionChange` を発行します。
5353

54-
開発者は通常通り `click` などの標準的なイベントを使用することができる。しかし、コンポーネントの [shadow root](../reference/glossary.md#shadow) 内で発生した多くのイベントは、ホスト要素に [retargeted](https://dom.spec.whatwg.org/#retarget) されます。この結果、ユーザーが 1 回しかクリックしなくても、複数の `click` ハンドラが実行される可能性があります。そのため、開発者は Ionic コンポーネントの状態変化を適切に通知するために、Ionic のイベントに頼る必要があります。Ionic のイベントには、標準的なイベントとの衝突を避けるために`ion`というプレフィックスが付けられています。各コンポーネントのドキュメントページには、開発者がアプリケーションでリッスンできる利用可能なイベントのリストがあります。
54+
開発者は通常通り click などの標準的なイベントを使用することができる。しかし、コンポーネントの [shadow root](../reference/glossary.md#shadow) 内で発生した多くのイベントは、ホスト要素に [retargeted](https://dom.spec.whatwg.org/#retarget) されます。この結果、ユーザーが 1 回しかクリックしなくても、複数の click ハンドラが実行される可能性があります。そのため、開発者は Ionic コンポーネントの状態変化を適切に通知するために、Ionic のイベントに頼る必要があります。Ionic のイベントには、標準的なイベントとの衝突を避けるためにionというプレフィックスが付けられています。各コンポーネントのドキュメントページには、開発者がアプリケーションでリッスンできる利用可能なイベントのリストがあります。
55+
56+
## Properties
57+
58+
Properties are JavaScript properties that can be set on Ionic components to configure their behavior and appearance. Properties are defined in each component's [API documentation](/docs/api) page.
59+
60+
### Reactive Properties
61+
62+
Reactive properties automatically update the component when their values change. These are the most common type of property in Ionic components.
63+
64+
```html
65+
<ion-button color="primary">Primary Button</ion-button>
66+
```
67+
68+
The `color` property is a reactive property that configures how the button appears. If you change the `color` value after the initial render, the button will update to reflect the new value.
69+
70+
### Virtual Properties
71+
72+
Virtual properties are designed for one-time configuration during component initialization. They do not trigger re-renders when updated.
73+
74+
```html
75+
<ion-button mode="ios">iOS Style Button</ion-button> <ion-button mode="md">Material Design Button</ion-button>
76+
```
77+
78+
The `mode` property is a virtual property that determines which platform styles to use for a component. It can be set at the component level or globally through the app configuration. In both cases, it's set once during initialization and doesn't change during the component's lifecycle.
79+
80+
For more information on Ionic modes, read the [Platform Styles documentation](/docs/theming/platform-styles).

docs/developing/hardware-back-button.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,9 @@ import { useBackButton } from '@ionic/vue';
122122
123123
...
124124
125-
export default {
126-
setup() {
127-
useBackButton(10, () => {
128-
console.log('Handler was called!');
129-
});
130-
}
131-
}
125+
useBackButton(10, () => {
126+
console.log('Handler was called!');
127+
});
132128
```
133129
</TabItem>
134130
</Tabs>
@@ -236,19 +232,15 @@ import { useBackButton } from '@ionic/vue';
236232
237233
...
238234
239-
export default {
240-
setup() {
241-
useBackButton(5, () => {
242-
console.log('Another handler was called!');
243-
});
235+
useBackButton(5, () => {
236+
console.log('Another handler was called!');
237+
});
244238
245-
useBackButton(10, (processNextHandler) => {
246-
console.log('Handler was called!');
239+
useBackButton(10, (processNextHandler) => {
240+
console.log('Handler was called!');
247241
248-
processNextHandler();
249-
});
250-
}
251-
}
242+
processNextHandler();
243+
});
252244
```
253245
</TabItem>
254246
</Tabs>
@@ -385,16 +377,12 @@ import { App } from '@capacitor/app';
385377
386378
...
387379
388-
export default {
389-
setup() {
390-
const ionRouter = useIonRouter();
391-
useBackButton(-1, () => {
392-
if (!ionRouter.canGoBack()) {
393-
App.exitApp();
394-
}
395-
});
380+
const ionRouter = useIonRouter();
381+
useBackButton(-1, () => {
382+
if (!ionRouter.canGoBack()) {
383+
App.exitApp();
396384
}
397-
}
385+
});
398386
```
399387
</TabItem>
400388
</Tabs>

docs/updating/6-0.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,8 @@ module.exports = {
196196
<ion-tab-bar slot="bottom"> ... </ion-tab-bar>
197197
</ion-tabs>
198198

199-
<script>
199+
<script setup lang="ts">
200200
import { IonTabs, IonTabBar } from '@ionic/vue';
201-
import { defineComponent } from 'vue';
202-
203-
export default defineComponent({
204-
components: { IonTabs, IonTabBar },
205-
});
206201
</script>
207202
```
208203

@@ -214,13 +209,8 @@ module.exports = {
214209
<ion-tab-bar slot="bottom"> ... </ion-tab-bar>
215210
</ion-tabs>
216211

217-
<script>
212+
<script setup lang="ts">
218213
import { IonTabs, IonTabBar, IonRouterOutlet } from '@ionic/vue';
219-
import { defineComponent } from 'vue';
220-
221-
export default defineComponent({
222-
components: { IonTabs, IonTabBar, IonRouterOutlet },
223-
});
224214
</script>
225215
```
226216

docs/vue/lifecycle.md

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,60 +22,51 @@ Ionic Framework はアプリで使えるいくつかのライフサイクルメ
2222
ライフサイクルは、Vue のライフサイクルメソッドと同じように、Vue コンポーネントのルートで関数として定義されます:
2323

2424
```tsx
25+
<script setup lang="ts">
2526
import { IonPage } from '@ionic/vue';
26-
import { defineComponent } from 'vue';
27-
28-
export default defineComponent({
29-
name: 'Home',
30-
ionViewDidEnter() {
31-
console.log('Home page did enter');
32-
},
33-
ionViewDidLeave() {
34-
console.log('Home page did leave');
35-
},
36-
ionViewWillEnter() {
37-
console.log('Home page will enter');
38-
},
39-
ionViewWillLeave() {
40-
console.log('Home page will leave');
41-
},
42-
components: {
43-
IonPage,
44-
},
45-
});
27+
28+
const ionViewDidEnter = () => {
29+
console.log('Home page did enter');
30+
};
31+
32+
const ionViewDidLeave = () => {
33+
console.log('Home page did leave');
34+
};
35+
36+
const ionViewWillEnter = () => {
37+
console.log('Home page will enter');
38+
};
39+
40+
const ionViewWillLeave = () => {
41+
console.log('Home page will leave');
42+
};
43+
</script>
4644
```
4745

4846
### Composition API Hooks
4947

5048
These lifecycles can also be expressed using Vue 3's Composition API:
5149

5250
```tsx
51+
<script setup lang="ts">
5352
import { IonPage, onIonViewWillEnter, onIonViewDidEnter, onIonViewWillLeave, onIonViewDidLeave } from '@ionic/vue';
54-
import { defineComponent } from 'vue';
55-
56-
export default defineComponent({
57-
name: 'Home',
58-
components: {
59-
IonPage,
60-
},
61-
setup() {
62-
onIonViewDidEnter(() => {
63-
console.log('Home page did enter');
64-
});
65-
66-
onIonViewDidLeave(() => {
67-
console.log('Home page did leave');
68-
});
69-
70-
onIonViewWillEnter(() => {
71-
console.log('Home page will enter');
72-
});
73-
74-
onIonViewWillLeave(() => {
75-
console.log('Home page will leave');
76-
});
77-
},
53+
54+
onIonViewDidEnter(() => {
55+
console.log('Home page did enter');
56+
});
57+
58+
onIonViewDidLeave(() => {
59+
console.log('Home page did leave');
60+
});
61+
62+
onIonViewWillEnter(() => {
63+
console.log('Home page will enter');
64+
});
65+
66+
onIonViewWillLeave(() => {
67+
console.log('Home page will leave');
7868
});
69+
</script>
7970
```
8071

8172
:::note

0 commit comments

Comments
 (0)