# xone
**Repository Path**: able99/xone
## Basic Information
- **Project Name**: xone
- **Description**: 基于 uniapp 的开发套件
- **Primary Language**: JavaScript
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 2
- **Created**: 2022-08-11
- **Last Updated**: 2026-06-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# xone
## project cli
***prepare***
node 14
*** project v2 ***
```sh
vue create -p dcloudio/uni-preset-vue my-project
npm i node-sass@4.14.1 -D # sass 目前 @dcloudio/vue-cli-plugin-uni 自带的 sass-loader 版本为8.0
npm i element-ui@2 # xone 使用
拷贝 uview-ui 到 uni_modules
```
*** project v3 ***
```sh
npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project
# npx @dcloudio/uvm # update
npm i sass@^1.49.0 -D # sass
```
## mp mini size
```json
"devm:custom": "cross-env NODE_ENV=development UNI_MINIMIZE=true uniapp-cli custom"
```
## xone cli
***添加到 package.json script***
```sh
npm i miniprogram-ci
PUPPETEER_SKIP_DOWNLOAD=true npm i miniprogram-ci
```
```json
"xone": "node src/uni_modules/xone/cli.js"
```
a. npm run xone mp preview 上传开发版,并显示二维码
a. npm run xone mp upload 上传开发版
a. npm run xone mp open 打开微信调试工具并打开工程
## eslint
```sh
# npx eslint --init # "eslint": "^8.7.0", "eslint-plugin-vue": "^8.3.0",
npm i eslint@^7 eslint-plugin-vue@^7 babel-eslint @vue/cli-plugin-eslint
```
*** .eslintrc.js ***
```js
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true
},
'extends': [
'plugin:vue/essential', 'plugin:vue/recommended', 'eslint:recommended'
],
"globals":{
"document": true,
"localStorage": true,
"window": true,
"uni": true, // uniapp
"uniCloud": true, // uniapp
"getApp": true, // uniapp
"getCurrentPages": true, // uniapp
"plus": true, // uniapp 5+ api
"wx": true, // wechat
},
rules: {
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': 'off',
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': 'off', // tmp
'no-useless-escape': 'off', // tmp
'no-unreachable': 'off', // tmp
'no-mutating-props': 'off', // tmp
'vue/no-mutating-props': 'off', // tmp
"vue/comment-directive": "off", // tmp
"vue/require-component-is": "off",
"vue/valid-template-root": "off",
"vue/script-indent": ["error", 2, {
"baseIndent": 1,
"switchCase": 1,
"ignores": []
}]
},
parserOptions: {
parser: 'babel-eslint'
}
}
```
*** .eslintignore ***
```
/src/uni_modules/uview
/src/uni_modules/uni-ui
```
## custom icon
*** import uview icons ***
```vue
```vue
```
*** ttf2base64 ***
https://transfonter.org/
## theme
### 配置 ###
```js
// =====================
// theme
// =====================
@import '../uni_modules/xone/style/theme/index.scss';
$uni-color-primary: #15ae67;//主色
$uni-color-success: #4cd964; // 成功色
$uni-color-warning: #fb753c; // 警告色
$uni-color-error: #dd524d; // 错误色
$uni-color-info: #8f939c; //没啥用
@import '../uni_modules/xone/style/theme/calc.scss';
```
### theme 变量 ###
xone/extend/theme.js
打开注释,复制字符串到 vars
## git
https://www.cnblogs.com/lsgxeva/p/8540758.html?ivk_sa=1024320u
## validator
https://github.com/yiminghe/async-validator
## test sub modules
## xone by sub module
***初始化工程***
```sh
git submodule add https://gitee.com/able99/xone.git ./src/uni_modules/xone
```
***使用工程***
```sh
# clone 后初始化
git submodule update --init --recursive
```
```sh
# 主库更改子库版本后,更新子库
git submodule update src/uni_modules/xone
```