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> </div>
</section> </section>
</ui-card> </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> </main>
</template> </template>
@ -21,7 +40,22 @@ export default Vue.extend({
data() { data() {
return { return {
mfm: '', 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> </script>