Skip to content

Commit

Permalink
vue-cli3非typescript版本
Browse files Browse the repository at this point in the history
  • Loading branch information
aiplat committed Mar 26, 2019
1 parent cd58b80 commit 91ba749
Show file tree
Hide file tree
Showing 86 changed files with 10,284 additions and 918 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/dist
/node_modules
/.idea
/docs
/src/statics
/src/assets
/public
56 changes: 56 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true
},
extends: ['plugin:vue/essential', 'airbnb-base'],
plugins: [
'vue'
],
globals: {
'ga': true,
'cordova': true,
'uni': true,
'__statics': true
},
'rules': {
'no-param-reassign': 0,
'import/first': 0,
'import/named': 2,
'import/namespace': 2,
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
"no-plusplus": 0,
"linebreak-style": 0,
"max-len": ['error', 2000],
"no-alert": 0,
"eol-last": 0,
"object-shorthand": 0,
"no-bitwise": 0,
"no-mixed-operators": 0,
"vue/no-parsing-error": [2, {"x-invalid-end-tag": false}],
"no-nested-ternary": 1,
"func-names": 0,
"consistent-return": 0,
"array-callback-return": 0,
"vue/script-indent": ["error", 2, {"baseIndent": 1}],
"global-require": 0,
"quote-props": [0, "always"],
"no-tabs": "off"
},
"overrides": [
{
'files': ['*.vue', '*.js'],
'rules': {
'indent': 'off'
}
}
]
};
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ test/
.vs/
.vscode/
nbproject/
unpackage/dist
unpackage/dist
/src/envType.js
/src/manifest.json
/src/mpConf.js
/src/pages.json
19 changes: 0 additions & 19 deletions App.vue

This file was deleted.

91 changes: 72 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,86 @@
# uniapp
# uniapp vue-cli3版本

- 基于 https://uniapp.dcloud.io/ 的uniapp
- vue2+vuex+cmui+html5+css3
- vue-cli3+vuex+cmui+html5+css3+less+sass+eslint
- 一次开发,同时打包成Android版app、iOS版app、H5版、微信小程序版、支付宝小程序版、百度小程序版、头条小程序7个平台,界面统一,功能一致。
- cmui仓库为https://github.com/aiplat/cmui.git
- 代码示例为 https://aiplat.com 的版本
- 代码示例为 https://aiplat.com 的版本
- uniapp vue2版本为https://github.com/aiplat/uniapp的master分支
- uniapp vue-cli3版本为https://github.com/aiplat/uniapp/tree/vuecli3的vuecli3分支

- 基于 https://uniapp.dcloud.io/ 的uni-app

---

# 代码目录结构

- assets ------静态css、images文件目录
- components ------公共组件目录
- pages ------视图目录
- plugins ------公共函数或插件目录
- service ------配置目录
- static ------静态资源目录
- vuex ------vuex目录
- unpackage/dist ------打包目录
- app.vue ------vue应用承载文件
- main.js ------vue应用入口文件
- manifest.json ------应用配置文件
- pages.json ------页面配置文件
- dist ------打包目录
- public
index.html ------入口公共html
- src
- assets ------静态css文件目录
- components ------公共组件目录
- pages ------视图目录
- aiplat ------aiplat项目视图目录
- common ------公共页面目录
- *** ------若有多个项目,请在这新增不同目录区分
- plugins ------公共函数或插件目录
- projects ------多个小程序各配置目录
- aiplat ------aiplat配置信息目录
- *** ------若有多个项目,请在这新增不同目录区分
- service ------配置目录
- static ------静态资源目录
- vuex ------vuex目录
- app.vue ------vue应用承载文件
- main.js ------vue应用入口文件
- manifest.json ------应用配置文件
- pages.json ------页面配置文件

---

# clone
- $ git clone https://github.com/aiplat/uniapp.git

# 安装依赖
- $ cd uniapp
- $ npm install

# 开发模式
- npm run dev (默认微信小程序开发)
- 打开微信开发者工具->小程序->导入项目->选择dist/dev/mp-weixin
- 若有多个项目同一个仓库,$ npm run dev --apptype=** 区分

# 打包项目
- $ npm run build (默认构建微信小程序)
- 单个项目(默认aiplat)代码打包到了dist/build/mp-weixin
- 若有多个项目同一个仓库,$ npm run build --apptype=** 区分

---

##注意
- 开发工具为任意,不一定要HbuilderX.如果也要同时打包成app,再导入项目到HbuilderX打包。
- 开发或构建成其他平台命令:
--这六个平台标识:alipay、baidu、toutiao、app(包含安卓和ios)、h5
--dev为开发模式,build为构建模式
--参数--apptype=aiplat为项目名,默认aiplat。
--例如:
---npm run dev-baidu为百度小程序开发模式
---npm run build-baidu为百度小程序构建模式

---

# eslint
- $ npm run lint (查看)
- $ npm run lint-fix (fix)

---

# projects -- 多个小程序各配置目录
## 默认aiplat,其中必须包含三个文件:manifest.json、mpConf.js、pages.json
- manifest.json -- uni-app应用的配置文件,用于指定应用的名称、图标、权限等。
- mpConf.js -- aiplat配置信息
- pages.json -- 用于对 uni-app 进行全局配置,决定页面文件的路径、窗口表现、设置多 tab 等

- 请在 https://wwww.dcloud.io/ 下载HBuilderX工具
- 开发操作步骤请参照uni-app官网: https://uniapp.dcloud.io/
## 当有其他项目时如miniQQ:
- 开发命令为npm run dev --apptype=miniQQ
- 构建命令为npm run build --apptype=miniQQ

---
26 changes: 26 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const plugins = [];
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui'];
process.UNI_LIBRARIES.forEach((libraryName) => {
plugins.push([
'import',
{
libraryName: libraryName,
customName: (name) => {
console.log(name);
return `${libraryName}/lib/${name}/${name}`;
},
},
]);
});
module.exports = {
presets: [
[
'@vue/app',
{
modules: 'commonjs',
useBuiltIns: 'entry',
},
],
],
plugins,
};
35 changes: 0 additions & 35 deletions components/copyright.vue

This file was deleted.

22 changes: 0 additions & 22 deletions main.js

This file was deleted.

97 changes: 0 additions & 97 deletions manifest.json

This file was deleted.

Loading

0 comments on commit 91ba749

Please sign in to comment.