Skip to content

Commit

Permalink
nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cksheuen committed Jun 1, 2024
1 parent d6abc4e commit 86df8fd
Show file tree
Hide file tree
Showing 37 changed files with 6,569 additions and 6,032 deletions.
42 changes: 42 additions & 0 deletions electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path')

function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})

// and load the index.html of the app.
mainWindow.loadFile('../dist/index.html')

// Open the DevTools.
// mainWindow.webContents.openDevTools()
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
createWindow()

app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
"name": "hdusystem",
"version": "0.0.0",
"private": true,
"main": "main.js",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"start": "electron .",
"build:electron": "npm run build && electron build/electron.js"
},
"dependencies": {
"@kangc/v-md-editor": "^2.3.16",
"electron": "^26.2.1",
"element-plus": "^2.3.8",
"less": "^4.1.3",
"less-loader": "^11.1.3",
Expand Down
16 changes: 16 additions & 0 deletions plugins/useFetch/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ref, toRefs } from 'vue';

export async function useFetch(url: string) {
const res = await fetch('https://dummyjson.com/products');
const json = await res.json();

const data = ref(null);
const error = ref(null);

fetch(url)
.then(res => res.json())
.then(json => (data.value = json))
.then(err => (error.value = err));

return json.value;
}
Loading

0 comments on commit 86df8fd

Please sign in to comment.