Update index.vue

This commit is contained in:
syuilo 2018-11-21 05:36:55 +09:00
parent 286674c2bb
commit db9c2913cf
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -11,6 +11,25 @@
</div>
</section>
</ui-card>
<ui-card>
<div slot="title">Dialog Generator</div>
<section class="fit-top">
<ui-select v-model="dialogType" placeholder="">
<option value="info">Info</option>
<option value="success">Success</option>
<option value="error">Error</option>
</ui-select>
<ui-input v-model="dialogTitle">
<span>Title</span>
</ui-input>
<ui-input v-model="dialogText">
<span>Text</span>
</ui-input>
<ui-switch v-model="dialogShowCancelButton">With cancel button</ui-switch>
<ui-button @click="showDialog">Show</ui-button>
</section>
</ui-card>
</main>
</template>
@ -21,7 +40,22 @@ export default Vue.extend({
data() {
return {
mfm: '',
dialogType: 'success',
dialogTitle: '',
dialogText: 'Hello World!',
dialogShowCancelButton: false
};
},
methods: {
showDialog() {
this.$root.alert({
type: this.dialogType,
title: this.dialogTitle,
text: this.dialogText,
showCancelButton: this.dialogShowCancelButton
});
}
}
});
</script>