Skip to content

Commit 8fed2cc

Browse files
André DietrichAndré Dietrich
authored andcommitted
fix: parcel vue warnings
1 parent 182e610 commit 8fed2cc

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

src/components/Editor.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,15 @@ function blobToUint8Array(blob) {
113113
export default {
114114
name: "Editor",
115115
components: { Recorder },
116-
props: ["storageId", "content", "lights", "connection", "toolbar"],
116+
inheritAttrs: false,
117+
props: ["storageId", "content", "connection", "toolbar"],
117118
118119
data() {
119120
const config = Utils.loadConfig();
120121
121-
let toolbar = true;
122-
123-
if (this.$props.toolbar !== undefined) {
124-
toolbar = this.$props.toolbar;
125-
}
126-
127122
return {
128123
lights: config.lights,
129124
user: config.user,
130-
toolbar: toolbar,
131125
recorder: { audio: false, webcam: false, desktop: false },
132126
133127
online: null,
@@ -1340,7 +1334,7 @@ I (study) ~[[ am going to study ]]~ harder this term.
13401334

13411335
<template>
13421336
<nav
1343-
v-if="toolbar"
1337+
v-if="toolbar !== false"
13441338
class="navbar navbar-light bg-light"
13451339
style="
13461340
border-top: solid lightgray 2px;

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Vue compile-time feature flags — required by the esm-bundler build of Vue.
2+
// Parcel has no built-in DefinePlugin equivalent, so we set them on globalThis
3+
// before Vue runs so the typeof-checks in vue/dist/vue.esm-bundler.js resolve.
4+
(globalThis as any).__VUE_OPTIONS_API__ = true;
5+
(globalThis as any).__VUE_PROD_DEVTOOLS__ = false;
6+
(globalThis as any).__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
7+
18
import { createApp } from 'vue'
29

310
// Configure Monaco Editor web workers for Parcel bundler.

src/views/LiaScript.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989
document.documentElement.clientWidth < document.documentElement.clientHeight,
9090
previewNotReady: true,
9191
compilationCounter: 0,
92-
mode: this.$props.mode || 0,
92+
currentMode: this.$props.mode || 0,
9393
editorIsReady: false,
9494
database,
9595
meta: {},
@@ -132,7 +132,7 @@ export default {
132132
},
133133
134134
changeMode(mode: number) {
135-
this.mode = mode;
135+
this.currentMode = mode;
136136
},
137137
138138
nostr() {
@@ -477,7 +477,7 @@ export default {
477477
id="btnradio1"
478478
autocomplete="off"
479479
@click="changeMode(-1)"
480-
:checked="mode < 0"
480+
:checked="currentMode < 0"
481481
/>
482482
<label class="btn btn-outline-secondary" for="btnradio1" title="Editor only">
483483
<i class="bi bi-pencil"></i>
@@ -489,7 +489,7 @@ export default {
489489
name="btnradio"
490490
id="btnradio2"
491491
autocomplete="off"
492-
:checked="mode === 0"
492+
:checked="currentMode === 0"
493493
@click="changeMode(0)"
494494
/>
495495
<label class="btn btn-outline-secondary" for="btnradio2" title="Split view">
@@ -507,7 +507,7 @@ export default {
507507
id="btnradio3"
508508
autocomplete="off"
509509
@click="changeMode(1)"
510-
:checked="mode > 0"
510+
:checked="currentMode > 0"
511511
/>
512512
<label class="btn btn-outline-secondary" for="btnradio3" title="Preview only">
513513
<i class="bi bi-eye"></i>
@@ -872,11 +872,11 @@ export default {
872872
:horizontal="horizontal"
873873
>
874874
<pane
875-
:hidden="mode > 0"
875+
:hidden="currentMode > 0"
876876
style="border-right: solid lightgray 2px"
877877
:class="{
878-
fullHeight: mode < 0 && horizontal,
879-
fullWidth: mode < 0 && !horizontal,
878+
fullHeight: currentMode < 0 && horizontal,
879+
fullWidth: currentMode < 0 && !horizontal,
880880
}"
881881
>
882882
<Editor
@@ -895,10 +895,10 @@ export default {
895895
</pane>
896896

897897
<pane
898-
:hidden="mode < 0"
898+
:hidden="currentMode < 0"
899899
:class="{
900-
fullHeight: mode > 0 && horizontal,
901-
fullWidth: mode > 0 && !horizontal,
900+
fullHeight: currentMode > 0 && horizontal,
901+
fullWidth: currentMode > 0 && !horizontal,
902902
}"
903903
>
904904
<div

0 commit comments

Comments
 (0)