Improve test page

This commit is contained in:
syuilo 2018-11-21 06:25:58 +09:00
parent 9b1612574e
commit 4198497237
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
2 changed files with 21 additions and 4 deletions

View File

@ -145,6 +145,9 @@ root(fill)
font-size 13px font-size 13px
opacity 0.7 opacity 0.7
&:empty
display none
* *
margin 0 margin 0

View File

@ -6,9 +6,14 @@
<ui-textarea v-model="mfm"> <ui-textarea v-model="mfm">
<span>MFM</span> <span>MFM</span>
</ui-textarea> </ui-textarea>
<div> </section>
<misskey-flavored-markdown :text="mfm" :i="$store.state.i"/> <section>
</div> <header>Preview</header>
<misskey-flavored-markdown :text="mfm" :i="$store.state.i"/>
</section>
<section>
<header style="margin-bottom:0;">AST</header>
<ui-textarea v-model="mfmAst" readonly tall style="margin-top:16px;"></ui-textarea>
</section> </section>
</ui-card> </ui-card>
@ -16,8 +21,9 @@
<div slot="title">Dialog Generator</div> <div slot="title">Dialog Generator</div>
<section class="fit-top"> <section class="fit-top">
<ui-select v-model="dialogType" placeholder=""> <ui-select v-model="dialogType" placeholder="">
<option value="info">Info</option> <option value="info">Information</option>
<option value="success">Success</option> <option value="success">Success</option>
<option value="warning">Warning</option>
<option value="error">Error</option> <option value="error">Error</option>
</ui-select> </ui-select>
<ui-input v-model="dialogTitle"> <ui-input v-model="dialogTitle">
@ -35,6 +41,8 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import parse from '../../../../mfm/parse';
import * as JSON5 from 'json5';
export default Vue.extend({ export default Vue.extend({
data() { data() {
@ -47,6 +55,12 @@ export default Vue.extend({
}; };
}, },
computed: {
mfmAst(): any {
return JSON5.stringify(parse(this.mfm), null, 2);
}
},
methods: { methods: {
showDialog() { showDialog() {
this.$root.alert({ this.$root.alert({