diff --git a/electron/main/index.ts b/electron/main/index.ts index 361b2e9..841e029 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -63,7 +63,7 @@ async function createWindow() { //nativeTheme.themeSource = "light" if (process.env.VITE_DEV_SERVER_URL) { // electron-vite-vue#298 - win.loadURL(url) + win.loadURL(url + '?dev=1') // Open devTool if the app is not packaged //win.webContents.openDevTools() } else { diff --git a/src/App.vue b/src/App.vue index 2cdb607..1deb8ee 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@ import HelloWorld from './components/HelloWorld.vue' import StatusBar from './components/StatusBar.vue' import Editor from './components/Editor.vue' - + export default { components: { @@ -20,6 +20,7 @@ theme: window.darkMode.initial, initialTheme: window.darkMode.initial, systemTheme: 'system', + development: window.location.href.indexOf("dev=1") !== -1, } }, @@ -66,6 +67,7 @@ import { ref, shallowRef } from 'vue' import { HeynoteEditor } from '../editor/editor.js' - import initialData from "../editor/fixture.js" + import testContent from "../editor/fixture.js" + + const initialContent = ` +∞∞∞text-a +Welcome to Heynote! + +[⌘ + Enter] Insert new note block +[⌘ + A] Select all text in a note block. Press again to select the whole scratchpad +[⌘ + ⌥ + Up/Down]  Add additional cursor above/below +∞∞∞text-a +` export default { props: [ "theme", + "development", ], mounted() { this.$refs.editor.addEventListener("selectionChange", (e) => { @@ -19,8 +30,7 @@ this.editor = new HeynoteEditor({ element: this.$refs.editor, - //content: "\n∞∞∞text\n", - content: initialData, + content: this.development ? testContent : initialContent, theme: this.theme, }) },