Code Monkey home page Code Monkey logo

antdesignvuewithelectron's Introduction

Electron + Ant Design 初始框架

结构

使用 Vue 3 + Vite + Electron + Ant Design 为便于展示,添加了一个很小的模块 tts,另做他用时,在View层删除即可

安装

  1. 请自行安装 node及npm,并建议使用npmmirror至**区或者cnpm npm install
  2. 在.env.*中配置各环境所使用的后端接口地址
  3. 请在上线前。关闭 app.config.js 文件中的 openDevTools

命令解释

npm run dev   # 本地开发   
npm run build:web # 打包出 Html 至 build-production 目录   
npm run build:electron  # 打包出对应系统的可执行程序至Dist目录 

Web编译支持docker,Linux/MacOS平台可以使用 sh start_docker_web.sh

问题及错误

受GitHub过慢的问题,Windows平台初次编译经常依赖包下载不下来, package.json 中已经使用了镜像,如果还是无法下载,可以在这里(https://registry.npmmirror.com/binary.html)下载到对应包, 然后放置到 C:\Users\你的用户名\AppData\Local\electron-builder\Cache,再重新编译

技术细节

关于路由

本程序添加了自动路由注册,除可以在router/index.ts中指定路由外,您可以在vue文件中添加

  name: 'tts', //路由组件名称
  isRouter: true,  //是否自动为路由
  isComponents: false,  // 是否自动注册为公共组件

会检测到并自动将tts注册为路由,具体的注册项为: {path: '/tts', name: 'TTS'}

可以使用以下代码,进行路由跳转

    const router = useRouter();
    const goHomePage = () => {
      console.log(router);
      router.push({ name: "TEMPFILE" });
    };

antdesignvuewithelectron's People

Contributors

wiconwang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.