Skip to content
神代綺凛 edited this page Jan 10, 2024 · 45 revisions

不太建议您阅读或学习本项目的代码,这是我在初学 vue 时边学边写的实践成品,很多地方都不够优雅;例如开发初期缺乏组件化思想,导致单页文件十分长,HTML 层级很多,可能会让您看得头晕眼花;又例如我上来就拿着 mdui 一通写,过了一年才发现有 vuetify,但是已经太迟了啊,我已经写了好多定制的样式了,全换过去再调一遍 UI 不如杀了我(

完全重构可能是指望不上了

⚠️ Notice

  • Thu, 22 Apr 2021 05:40 GMT
    In order to facilitate development and maintenance, this repository has been rewritten to delete large files from git history such as deleted images.

Project setup

yarn

Compiles and hot-reloads for development

yarn serve

Compiles and minifies for production

yarn build

Lints and fixes files

yarn lint

Customize configuration

See Configuration Reference.

Use local resources

By default it will use online resources from data-cf.arkntools.app.

If you want to use local resources for better development, follow the command below (linux example):

echo "VUE_APP_DATA_BASE_URL=" >> .env.local
cd ..
git clone https://github.com/arkntools/arknights-toolbox-data.git --depth=1
cd arknights-toolbox-data
yarn
yarn build

Environment variables

You can create .env.local file to set environment variables during development.

  • VUE_APP_DATA_BASE_URL - Required, specifies where toolbox data are loaded from.
    • By default it is set to https://data-cf.arkntools.app in .env file. It can be override by system environment variable.
    • You can set it to empty during development to use local data (see above).
  • VUE_APP_GTAG - Optional, Google Analytics gtag ID.
  • VUE_APP_CDN - Optional, CDN URL of static resources, usually ends with a slash /. Most static resources (js, css) will be loaded from CDN.
    • Because of some limitations of PWA, some files will be automatically processed to ensure that index.html, manifest.json, service-worker.js will not be loaded from CDN.

Deploy to GitHub Pages automatically

After forking this repo, you can enable GitHub Actions on "Actions" page, and set the following secrets:

  • DATA_BASE_URL: Corresponding to environment variable VUE_APP_DATA_BASE_URL
  • GTAG: Corresponding to environment variable VUE_APP_GTAG
  • CDN: Corresponding to environment variable VUE_APP_CDN

Then go to Settings - Pages - Build and deployment - Source, select "GitHub Actions".