vue-material/docs/src/pages/components/Dialog.vue

72 lines
2 KiB
Vue
Raw Normal View History

2016-11-16 19:56:26 +00:00
<template>
<demo-page label="Components - Dialog">
<div slot="examples">
2016-11-21 04:34:28 +00:00
<demo-example label="Default" height="500">
<md-dialog ref="dialog1">
2016-11-22 00:30:32 +00:00
<md-dialog-content>
<h2 class="md-title">Use Google's location service?</h2>
<p>Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.</p>
</md-dialog-content>
2016-11-16 19:56:26 +00:00
2016-11-22 00:30:32 +00:00
<md-dialog-actions>
<md-button class="md-primary" @click="closeDialog('dialog1')">Disagree</md-button>
<md-button class="md-primary" @click="closeDialog('dialog1')">Agree</md-button>
</md-dialog-actions>
2016-11-16 19:56:26 +00:00
</md-dialog>
<md-dialog md-open-from="#trigger" md-close-to="#trigger" ref="dialog2">
2016-11-22 00:30:32 +00:00
<md-dialog-content>
<h2 class="md-title">Create new note</h2>
<form>
<md-input-container>
2016-11-22 00:30:32 +00:00
<label>Note</label>
<md-textarea></md-textarea>
</md-input-container>
</form>
2016-11-22 00:30:32 +00:00
</md-dialog-content>
2016-11-22 00:30:32 +00:00
<md-dialog-actions>
<md-button class="md-primary" @click="closeDialog('dialog2')">Cancel</md-button>
<md-button class="md-primary" @click="closeDialog('dialog2')">Create</md-button>
</md-dialog-actions>
</md-dialog>
<md-button class="md-primary md-raised" @click="openDialog('dialog1')">Simple</md-button>
2016-11-21 04:34:28 +00:00
<md-button class="md-fab md-fab-bottom-right" id="trigger" @click="openDialog('dialog2')">
2016-11-22 00:30:32 +00:00
<md-icon>add</md-icon>
2016-11-21 04:34:28 +00:00
</md-button>
2016-11-16 19:56:26 +00:00
</demo-example>
</div>
<div slot="code">
<demo-example label="Default">
<code-block lang="xml">
</code-block>
</demo-example>
</div>
<div slot="api">
</div>
</demo-page>
</template>
<style lang="scss" scoped>
</style>
<script>
export default {
methods: {
openDialog(ref) {
this.$refs[ref].open();
2016-11-16 19:56:26 +00:00
},
closeDialog(ref) {
this.$refs[ref].close();
2016-11-16 19:56:26 +00:00
}
}
};
</script>