Skip to content

Commit

Permalink
docs(vue): add vuejs usage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltintiuc authored and jthoms1 committed Feb 27, 2019
1 parent 22d1aee commit e7d41ad
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions core/src/components/modal/usage/vue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
```vue
<template>
<div>
<ion-header>
<ion-toolbar>
<ion-title>{{ title }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
{{ content }}
</ion-content>
</div>
</template>
<script>
export default {
name: 'Modal',
props: {
title: { type: String, default: 'Super Modal' },
},
data() {
return {
content: 'Content',
}
},
}
</script>
```

```vue
<template>
<ion-page class="ion-page" main>
<ion-content class="ion-content" padding>
<ion-button @click="openModal">Open Modal</ion-button>
</ion-content>
</ion-page>
</template>
<script>
import Modal from './modal.vue'
export default {
methods: {
openModal() {
return this.$ionic.modalController
.create({
component: Modal,
componentProps: {
data: {
content: 'New Content',
},
propsData: {
title: 'New title',
},
},
})
.then(m => m.present())
},
},
}
</script>
```

0 comments on commit e7d41ad

Please sign in to comment.