Skip to content

Commit

Permalink
Update DEMO
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jan 8, 2021
1 parent 84044db commit 2fbba00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion explorer/src/components/AstExplorer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="ast-explorer-root">
<AstOptions v-model="options" />
<div class="ast-tools">{{ time }}<AstOptions v-model="options" /></div>
<div class="ast-explorer">
<MonacoEditor
ref="sourceEditor"
Expand Down Expand Up @@ -42,6 +42,7 @@ export default {
`,
astJson: {},
modeEditor: "",
time: "",
}
},
watch: {
Expand All @@ -57,6 +58,7 @@ export default {
methods: {
refresh() {
let ast
const start = Date.now()
try {
ast = yamlEslintParser.parseForESLint(this.yamlValue).ast
} catch (e) {
Expand All @@ -65,6 +67,8 @@ export default {
...e,
}
}
const time = Date.now() - start
this.time = `${time}ms`
const json = createAstJson(this.options, ast)
this.astJson = json
},
Expand Down Expand Up @@ -308,6 +312,9 @@ function isNode(value) {
flex-direction: column;
height: 100%;
}
.ast-tools {
text-align: right;
}
.ast-explorer {
min-width: 1px;
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/components/AstOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export default {

<style scoped>
.ast-options {
text-align: right;
padding-left: 16px;
}
</style>

0 comments on commit 2fbba00

Please sign in to comment.