Global setting for live editor visibility

pull/880/head
Cagatay Civici 2021-01-19 10:52:41 +03:00
parent 277b0a2e89
commit 44eefa9bea
2 changed files with 8 additions and 3 deletions

View File

@ -110,7 +110,7 @@ router.beforeEach(function (to, from, next) {
const app = createApp(App);
app.config.globalProperties.$appState = reactive({inputStyle: 'outlined', darkTheme: false});
app.config.globalProperties.$appState = reactive({inputStyle: 'outlined', darkTheme: false, codeSandbox: false});
app.use(PrimeVue, {ripple: true});
app.use(ToastService);

View File

@ -1,5 +1,5 @@
<template>
<span style="margin-top: -0.2rem">
<span v-if="showEditor">
<Button @click="postSandboxParameters()" label="Edit in CodeSandbox" class="liveEditorButton" />
</span>
</template>
@ -45,7 +45,7 @@ export default {
activeButtonIndex: {
type: String,
default: null
},
}
},
methods: {
postSandboxParameters() {
@ -494,6 +494,11 @@ img.flag {
return this.createSandboxParameters(`${name}${extension}`, _files, extDependencies);
}
},
computed: {
showEditor() {
return this.$appState.codeSandbox;
}
}
}
</script>