mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
feat: 更新模板
This commit is contained in:
parent
f8c03ff00f
commit
c373b22868
@ -13,19 +13,34 @@
|
||||
"easy",
|
||||
"strong"
|
||||
],
|
||||
"files": [
|
||||
".eslintrc.js",
|
||||
".gitignore",
|
||||
".fes.js",
|
||||
".fes.prod.js",
|
||||
"mock.js",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"tsconfig.json",
|
||||
"/src",
|
||||
"/config"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/WeBankFinTech/fes.js.git",
|
||||
"directory": "packages/fes-template-h5"
|
||||
},
|
||||
"author": "harrywan qlin",
|
||||
"author": "qlin",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/WeBankFinTech/fes.js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/WeBankFinTech/fes.js#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webank/eslint-config-webank": "0.2.7",
|
||||
"@webank/eslint-config-webank": "^0.2.10",
|
||||
"postcss-px-to-viewport": "1.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -33,5 +48,6 @@
|
||||
"@webank/fes-plugin-icon": "^2.0.0-alpha.0",
|
||||
"@webank/fes-plugin-request": "^2.0.0-alpha.0",
|
||||
"vue": "3.0.5"
|
||||
}
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
<meta name="format-detection" content="email=no"/>
|
||||
<meta name="viewport" content="viewport-fit=cover,width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="./logo.png">
|
||||
</head>
|
||||
<body ontouchstart="">
|
||||
<div id="app"></div>
|
||||
|
BIN
packages/create-fes-app/templates/app/h5/public/logo.png
Normal file
BIN
packages/create-fes-app/templates/app/h5/public/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
@ -1,19 +1,14 @@
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@webank/eslint-config-webank/vue.js'
|
||||
extends: ['@webank/eslint-config-webank/vue.js'],
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
'**/__tests__/*.{j,t}s?(x)',
|
||||
'**/tests/unit/**/*.spec.{j,t}s?(x)'
|
||||
]
|
||||
}
|
||||
],
|
||||
globals: {
|
||||
// 这里填入你的项目需要的全局变量
|
||||
// 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
|
||||
//
|
||||
// Vue: false
|
||||
__DEV__: false
|
||||
},
|
||||
rules: {
|
||||
'vue/comment-directive': 'off',
|
||||
'global-require': 'off',
|
||||
'import/no-unresolved': 'off',
|
||||
'no-restricted-syntax': 'off'
|
||||
env: {
|
||||
jest: true
|
||||
}
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ export default {
|
||||
},
|
||||
layout: {
|
||||
title: "Fes.js",
|
||||
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
|
||||
footer: 'Created by MumbelFe',
|
||||
multiTabs: false,
|
||||
menus: [{
|
||||
name: 'index'
|
||||
@ -27,5 +27,8 @@ export default {
|
||||
},
|
||||
devServer: {
|
||||
port: 8080
|
||||
},
|
||||
enums: {
|
||||
status: [['0', '无效的'], ['1', '有效的']]
|
||||
}
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
/coverage
|
||||
|
||||
# fes
|
||||
/src/.fes
|
||||
|
@ -0,0 +1,5 @@
|
||||
import sum from "@/utils/sum"
|
||||
|
||||
test('adds 1 + 2 to equal 3', () => {
|
||||
expect(sum(1, 2)).toBe(3);
|
||||
});
|
@ -6,7 +6,8 @@
|
||||
"build": "fes build",
|
||||
"prod": "FES_ENV=prod fes build",
|
||||
"analyze": "ANALYZE=1 fes build",
|
||||
"dev": "fes dev"
|
||||
"dev": "fes dev",
|
||||
"test:unit": "fes test:unit"
|
||||
},
|
||||
"keywords": [
|
||||
"管理端",
|
||||
@ -15,6 +16,18 @@
|
||||
"easy",
|
||||
"strong"
|
||||
],
|
||||
"files": [
|
||||
".eslintrc.js",
|
||||
".gitignore",
|
||||
".fes.js",
|
||||
".fes.prod.js",
|
||||
"mock.js",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"tsconfig.json",
|
||||
"/src",
|
||||
"/config"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/WeBankFinTech/fes.js.git",
|
||||
@ -26,8 +39,11 @@
|
||||
"url": "https://github.com/WeBankFinTech/fes.js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/WeBankFinTech/fes.js#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webank/eslint-config-webank": "0.2.7"
|
||||
"@webank/eslint-config-webank": "^0.2.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@webank/fes": "^2.0.0-alpha.0",
|
||||
@ -35,8 +51,13 @@
|
||||
"@webank/fes-plugin-layout": "^2.0.0-alpha.0",
|
||||
"@webank/fes-plugin-locale": "^2.0.0-alpha.0",
|
||||
"@webank/fes-plugin-model": "^2.0.0-alpha.0",
|
||||
"@webank/fes-plugin-enums": "^2.0.0-alpha.0",
|
||||
"@webank/fes-plugin-jest": "^2.0.0-alpha.0",
|
||||
"@webank/fes-plugin-vuex": "^2.0.0-alpha.0",
|
||||
"ant-design-vue": "2.0.0-rc.3",
|
||||
"vue": "3.0.5"
|
||||
}
|
||||
"vue": "3.0.5",
|
||||
"vuex": "^4.0.0-rc.2"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>fes Vue3</title>
|
||||
<title>fes.js</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="./logo.png">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
BIN
packages/create-fes-app/templates/app/pc/public/logo.png
Normal file
BIN
packages/create-fes-app/templates/app/pc/public/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
@ -5,6 +5,11 @@
|
||||
<access :id="accessId"> accessOnepicess1 <input /> </access>
|
||||
<div v-access="accessId"> accessOnepicess2 <input /> </div>
|
||||
<input />
|
||||
<h4>数据字典</h4>
|
||||
<div v-for="item in enumsGet('status')" :key="item.key">{{item.value}}:{{item.key}}</div>
|
||||
<div v-for="item in roles" :key="item.key">{{item.name}}:{{item.disabled}}</div>
|
||||
<div>{{enumsGet('roles', '2', { dir: 'eName' })}}</div>
|
||||
<h4>Vuex <button @click="increment">click me:{{count}}</button></h4>
|
||||
</div>
|
||||
</template>
|
||||
<config>
|
||||
@ -14,9 +19,10 @@
|
||||
}
|
||||
</config>
|
||||
<script>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, computed } from 'vue';
|
||||
import { useStore } from 'vuex';
|
||||
import {
|
||||
access, useAccess, useRouter, useI18n, locale
|
||||
access, useAccess, useRouter, useI18n, locale, enums
|
||||
} from '@webank/fes';
|
||||
|
||||
export default {
|
||||
@ -26,6 +32,41 @@ export default {
|
||||
const localI18n = useI18n();
|
||||
const router = useRouter();
|
||||
const accessId = ref('/onepiece1');
|
||||
enums.push('roles', [
|
||||
{
|
||||
id: '1',
|
||||
cName: '系统管理员',
|
||||
eName: 'System',
|
||||
perm: ['1', '2', '3']
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
cName: '业务管理员',
|
||||
eName: 'Business',
|
||||
perm: ['1', '2']
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
cName: '普通用户',
|
||||
eName: 'User',
|
||||
perm: ['1']
|
||||
}
|
||||
], { keyName: 'id' });
|
||||
const roles = enums.get('roles', {
|
||||
extend: [
|
||||
{
|
||||
key: 'name',
|
||||
dir: 'cName'
|
||||
},
|
||||
{
|
||||
key: 'disabled',
|
||||
transfer: item => item.value.perm.some(i => i >= 2)
|
||||
}
|
||||
]
|
||||
});
|
||||
console.log(roles);
|
||||
const store = useStore();
|
||||
console.log('store==>', store);
|
||||
onMounted(() => {
|
||||
console.log(router);
|
||||
setTimeout(() => {
|
||||
@ -43,7 +84,11 @@ export default {
|
||||
accessId,
|
||||
fes,
|
||||
accessOnepicess,
|
||||
t: localI18n.t
|
||||
t: localI18n.t,
|
||||
enumsGet: enums.get,
|
||||
roles,
|
||||
count: computed(() => store.state.counter.count),
|
||||
increment: () => store.commit('counter/increment')
|
||||
};
|
||||
}
|
||||
};
|
||||
|
10
packages/create-fes-app/templates/app/pc/src/pages/test.vue
Normal file
10
packages/create-fes-app/templates/app/pc/src/pages/test.vue
Normal file
@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<div>test</div>
|
||||
</template>
|
||||
<script>
|
||||
import { } from '@webank/fes';
|
||||
|
||||
export default {
|
||||
|
||||
};
|
||||
</script>
|
@ -0,0 +1,23 @@
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: () => ({
|
||||
count: 0
|
||||
}),
|
||||
mutations: {
|
||||
increment(state) {
|
||||
state.count++;
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
doubleCount(state) {
|
||||
return state.count * 2;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
asyncIncrement({ commit }) {
|
||||
setTimeout(() => {
|
||||
commit('increment');
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
import { createLogger } from 'vuex';
|
||||
|
||||
export default createLogger();
|
25
packages/create-fes-app/templates/app/pc/src/stores/user.js
Normal file
25
packages/create-fes-app/templates/app/pc/src/stores/user.js
Normal file
@ -0,0 +1,25 @@
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: () => ({
|
||||
name: 'aring',
|
||||
age: 20,
|
||||
count: 0
|
||||
}),
|
||||
mutations: {
|
||||
increment(state) {
|
||||
state.count++;
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
doubleCount(state) {
|
||||
return state.count * 2;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
asyncIncrement({ commit }) {
|
||||
setTimeout(() => {
|
||||
commit('increment');
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
export default function sum(a, b) {
|
||||
return a + b;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user