improve codebase

This commit is contained in:
Nitwel
2020-08-18 21:33:14 +02:00
parent 7825b65bd5
commit 8124cf6be4
2 changed files with 8 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import markdown from './readme.md';
import withPadding from '../../../.storybook/decorators/with-padding';
import { defineComponent, ref } from '@vue/composition-api';
import RawValue from '../../../.storybook/raw-value.vue';
import i18n from '@/lang';
Vue.component('interface-markdown', InterfaceMarkdown);
@@ -20,6 +21,7 @@ export default {
export const basic = () =>
defineComponent({
components: { RawValue },
i18n,
props: {
disabled: {
default: boolean('Disabled', false, 'Options'),

View File

@@ -13,13 +13,13 @@
</v-tabs>
</div>
<v-textarea
v-show="!tabbed || currentTab == 0"
v-show="showEdit"
:placeholder="placeholder"
:value="value"
:disabled="disabled"
@input="$listeners.input"
/>
<div v-show="!tabbed || currentTab != 0" class="preview-container">
<div v-show="showPreview" class="preview-container">
<div class="preview" v-html="html"></div>
</div>
</div>
@@ -52,15 +52,17 @@ export default defineComponent({
const currentTab = ref(0);
const html = computed(() => marked(props.value));
const showEdit = computed(() => !props.tabbed || currentTab.value == 0);
const showPreview = computed(() => !props.tabbed || currentTab.value != 0);
return { html, currentTab };
return { html, currentTab, showEdit, showPreview };
},
});
</script>
<style lang="scss" scoped>
.interface-markdown {
--v-textarea-min-height: 200px;
--v-textarea-min-height: var(--input-height-tall);
--v-textarea-max-height: 400px;
display: flex;