Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Sep 16, 2024
1 parent 22222e8 commit 35570ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/SplitPane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const previewRef = inject(injectKeyPreviewRef)!
// mobile only
const { store, splitPaneOptions } = inject(injectKeyProps)!
const showOutput = computed(() => store.value.showOutput)
const state = reactive({
dragging: false,
Expand Down Expand Up @@ -66,7 +65,7 @@ function changeViewSize() {
class="split-pane"
:class="{
dragging: state.dragging,
'show-output': showOutput,
'show-output': store.showOutput,
vertical: isVertical,
}"
@mousemove="dragMove"
Expand All @@ -90,9 +89,9 @@ function changeViewSize() {
<slot name="right" />
</div>

<button class="toggler" @click="store.showOutput = !showOutput">
<button class="toggler" @click="store.showOutput = !store.showOutput">
{{
showOutput
store.showOutput
? splitPaneOptions?.codeTogglerText || '< Code'
: splitPaneOptions?.outputTogglerText || 'Output >'
}}
Expand Down

0 comments on commit 35570ee

Please sign in to comment.