Skip to content

Commit

Permalink
release v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FuShaoLei committed Sep 5, 2024
1 parent b248b54 commit 8869354
Show file tree
Hide file tree
Showing 12 changed files with 339 additions and 224 deletions.
76 changes: 9 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,21 @@
# electron-vite-vue
# Memory-Desktop

🥳 Really simple `Electron` + `Vue` + `Vite` boilerplate.

<!-- [![awesome-vite](https://awesome.re/mentioned-badge.svg)](https://github.com/vitejs/awesome-vite) -->
<!-- [![Netlify Status](https://api.netlify.com/api/v1/badges/ae3863e3-1aec-4eb1-8f9f-1890af56929d/deploy-status)](https://app.netlify.com/sites/electron-vite/deploys) -->
<!-- [![GitHub license](https://img.shields.io/github/license/caoxiemeihao/electron-vite-vue)](https://github.com/electron-vite/electron-vite-vue/blob/main/LICENSE) -->
<!-- [![GitHub stars](https://img.shields.io/github/stars/caoxiemeihao/electron-vite-vue?color=fa6470)](https://github.com/electron-vite/electron-vite-vue) -->
<!-- [![GitHub forks](https://img.shields.io/github/forks/caoxiemeihao/electron-vite-vue)](https://github.com/electron-vite/electron-vite-vue) -->
[![GitHub Build](https://github.com/electron-vite/electron-vite-vue/actions/workflows/build.yml/badge.svg)](https://github.com/electron-vite/electron-vite-vue/actions/workflows/build.yml)
[![GitHub Discord](https://img.shields.io/badge/chat-discord-blue?logo=discord)](https://discord.gg/sRqjYpEAUK)

## Features
A Desktop App For Upload Image To Github

📦 Out of the box
🎯 Based on the official [template-vue-ts](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-vue-ts), less invasive
🌱 Extensible, really simple directory structure
💪 Support using Node.js API in Electron-Renderer
🔩 Support C/C++ native addons
🖥 It's easy to implement multiple windows

## Quick Setup

```sh
# clone the project
git clone https://github.com/electron-vite/electron-vite-vue.git
## Download

# enter the project directory
cd electron-vite-vue
[Click Here🤟](https://github.com/FuShaoLei/memory-desktop/releases)

# install dependency
npm install
## ScreenShot

# develop
npm run dev
```
![](./screenshot/img1.png)

## Debug
![](./screenshot/img2.png)

![electron-vite-react-debug.gif](https://github.com/electron-vite/electron-vite-react/blob/main/electron-vite-react-debug.gif?raw=true)
## Thanks

## Directory

```diff
+ ├─┬ electron
+ │ ├─┬ main
+ │ │ └── index.ts entry of Electron-Main
+ │ └─┬ preload
+ │ └── index.ts entry of Preload-Scripts
├─┬ src
│ └── main.ts entry of Electron-Renderer
├── index.html
├── package.json
└── vite.config.ts
```

<!--
## Be aware
🚨 By default, this template integrates Node.js in the Renderer process. If you don't need it, you just remove the option below. [Because it will modify the default config of Vite](https://github.com/electron-vite/vite-plugin-electron-renderer#config-presets-opinionated).
```diff
# vite.config.ts
export default {
plugins: [
- // Use Node.js API in the Renderer-process
- renderer({
- nodeIntegration: true,
- }),
],
}
```
-->

## FAQ

- [C/C++ addons, Node.js modules - Pre-Bundling](https://github.com/electron-vite/vite-plugin-electron-renderer#dependency-pre-bundling)
- [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron-renderer#dependencies-vs-devdependencies)
- [electron-vite-vue](https://github.com/electron-vite/electron-vite-vue)
2 changes: 2 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const indexHtml = path.join(RENDERER_DIST, 'index.html')

async function createWindow() {
win = new BrowserWindow({
width: 900,
height: 700,
title: 'Main window',
icon: path.join(process.env.VITE_PUBLIC, 'favicon.ico'),
webPreferences: {
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<title>Electron + Vite + Vue</title>
<title>Memory</title>
</head>
<body>
<div id="app"></div>
Expand Down
Binary file added screenshot/img1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/img2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/api/GithubApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import request from "../utils/request.js";
import {useSettingsStore} from "../stores/settingsData.js";


export function testGithubApi() {
export function getContents() {
const mSettingsStore = useSettingsStore();

return request({
Expand Down
62 changes: 62 additions & 0 deletions src/components/GithubSettings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<div>
<el-form label-width="170px" :rules="settingsFormRules" :model="settingsForm" ref="settingsFormRef">
<el-form-item label="Token" prop="token">
<el-input v-model="settingsForm.token" clearable style="width: 400px;margin-right: 10px"></el-input>
</el-form-item>

<el-form-item label="User" prop="name">
<el-input v-model="settingsForm.name" clearable style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="Repo" prop="repo">
<el-input v-model="settingsForm.repo" clearable style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="Branch" prop="repo">
<el-input v-model="settingsForm.branch" clearable style="width: 400px"></el-input>
</el-form-item>
</el-form>
</div>
</template>
<script setup="GithubSettings">
import {ref, defineExpose} from "vue";
import {useSettingsStore} from "../stores/settingsData.js";
const settingsFormRef = ref()
let settingsForm = ref(
{
token: "",
name: "",
repo: "",
branch:""
}
)
const settingsFormRules = ref({
token: [{required: true, message: 'Please input Token',trigger: 'blur'}],
name: [{required: true, message: 'Please input User Name',trigger: 'blur'}],
repo: [{required: true, message: 'Please input Repo Name',trigger: 'blur'}],
branch: [{required: true, message: 'Please input Repo Name',trigger: 'blur'}]
})
function init() {
settingsForm.value = {...useSettingsStore().githubSettings}
}
function updateSettingsData() {
settingsFormRef.value.validate((valid, fields) => {
if (valid) {
useSettingsStore().setGithubSettings(settingsForm.value)
}
})
}
defineExpose({
init,
updateSettingsData
})
</script>
<style scoped>
</style>
Loading

0 comments on commit 8869354

Please sign in to comment.