Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auto import modules and language #1815

Merged
merged 149 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
3802f6f
fix[ExternalLink]: fixed bug when url include chinese #1182
PanJiaChen Oct 10, 2018
0f7cf7e
feature: support Spanish(#1196)
rmenor Oct 15, 2018
97261a2
fix[MockJS]: fix bug with withCredentials after using mockjs (#1194)
Aysnine Oct 15, 2018
4cdcbee
update readme
PanJiaChen Oct 15, 2018
2777294
perf[tagsView]: refactor the moveToTarget function (#1195)
frank10000 Oct 16, 2018
a67b455
fix[tagsView]: fixed moveToCurrentTag bug
PanJiaChen Oct 17, 2018
b9eedb8
feature: add pagination component (#1213)
PanJiaChen Oct 17, 2018
2ba5f25
fix[TagsView]: fixed update tags title demo bug (#1223)
PanJiaChen Oct 18, 2018
6f0c40e
chore: temporary hack cssnano bug #1222
PanJiaChen Oct 19, 2018
ccc9050
[release] 3.9.2
PanJiaChen Oct 19, 2018
1003154
chore: restore the hack of cssnano bug
PanJiaChen Oct 23, 2018
f79d0fe
add an example of sort data by table (#1236)
PanJiaChen Oct 23, 2018
c042dc8
feature: add drag select component (#1249)
PanJiaChen Oct 24, 2018
6c967f1
Merge branch 'master' into v4.0
PanJiaChen Oct 26, 2018
40a7626
feat: perfect migrate to @vue/cli-service, upgrade vue babel version …
zthxxx Oct 29, 2018
aefd8bb
update
PanJiaChen Oct 29, 2018
51f9977
add test
PanJiaChen Oct 29, 2018
da286d4
fix bug
PanJiaChen Nov 1, 2018
2151617
fix[Charts]: fixed charts resize mixins bug #1285 (#1290)
LarchLiu Nov 2, 2018
889771f
perf[Tinymce]: add searchreplace plugin
PanJiaChen Nov 2, 2018
4b916c8
perf[avatar]:minimize the selected area of avatar on the mobile phone…
jaysunxiao Nov 6, 2018
8e5b142
refine css
PanJiaChen Nov 6, 2018
8921752
fix[DragSelect]: fixed querySelectorAll bug
PanJiaChen Nov 8, 2018
cfdff38
perf[DragSelect]: add $listeners
PanJiaChen Nov 8, 2018
14ece5b
fix link
PanJiaChen Nov 9, 2018
5c23acc
fix[Breadcurmb]: fixed pathCompile bug
PanJiaChen Nov 9, 2018
6f5591c
fix[Breadcurmb]: fixed router-link bug
PanJiaChen Nov 9, 2018
f0f8363
perf[style]: use webpack alias instead of hard code src path (#1338)
samuelchlui Nov 19, 2018
8cb6983
perf[style]: use webpack alias instead of hard code src path
PanJiaChen Nov 19, 2018
05b28e2
add sponsors
PanJiaChen Nov 21, 2018
5f343ec
fix import path bug
PanJiaChen Nov 21, 2018
5849b13
update vue-router to fixed url path for non ascii urls #1362
PanJiaChen Nov 26, 2018
8836133
fix[Pagination]: apply PageSizes property to el-pagination (#1355)
painnick Nov 26, 2018
929a4fc
update dependence
PanJiaChen Nov 27, 2018
a6c8e1a
add tui.editor (#1374)
PanJiaChen Nov 28, 2018
2f73100
tweak
PanJiaChen Nov 28, 2018
84b19d7
add preview
PanJiaChen Nov 28, 2018
075d29a
fix return back bug
PanJiaChen Nov 29, 2018
b8b7877
update guide page
PanJiaChen Dec 4, 2018
49f1e5e
fix[Tinymce]: fixed fullScreen bug #1400
PanJiaChen Dec 4, 2018
9ce0f81
feat[Breadcrumb]: add hide Breadcrumb option #1442
PanJiaChen Dec 24, 2018
a92151d
perf: use WeChat 7.0 new version icon color
PanJiaChen Dec 24, 2018
3a2da6a
refactor[login]: refactor login page style
PanJiaChen Dec 24, 2018
cff015f
perf[ScrollPane]: refine moveToTarget code (#1460)
rainydayDY Dec 26, 2018
5a1fa14
feature[PDF]: add PDF demo (#1469)
PanJiaChen Dec 27, 2018
d3904e6
perf[v-permission]: refine v-permission demo
PanJiaChen Dec 27, 2018
67c0602
perf[Sidebar]: refine sidebar store #1473 (#1474)
PanJiaChen Dec 28, 2018
94ed283
refine: GetUserInfo error message
PanJiaChen Jan 9, 2019
4e9f08e
fix typo (#1505)
sobolevn Jan 10, 2019
1cd1ef6
perf: add sidebar width to variables.scss (#1494)
duynguyenhoang Jan 11, 2019
77113a0
tweak
PanJiaChen Jan 11, 2019
bae3601
fix[ThemePicker]: fixed bug when oldVal is null (#1517)
PanJiaChen Jan 14, 2019
0bf8b59
update README.md
PanJiaChen Jan 15, 2019
3af14bc
fix[Breadcrumb]: fixed eslint error (#1521)
PanJiaChen Jan 15, 2019
4afb57a
fix[DndList]: fixed drag bug (#1527)
PanJiaChen Jan 16, 2019
bb50a74
pref[Hamburger]: refactor Hamburger component (#1528)
jiankian Jan 16, 2019
78e8888
perf[Login Form]: optimize eye icon style (#1545)
yugasun Jan 23, 2019
93c13d2
perf[Sticky]: export reset method (#1550)
PanJiaChen Jan 24, 2019
2d275a9
perf[Sticky]: refine width default value
PanJiaChen Jan 24, 2019
22cdfc2
perf[utils]: refine parseTime function (#1546)
xbigcat Jan 24, 2019
0f6946a
perf[UploadExcel]: optimized code (#1552)
PanJiaChen Jan 25, 2019
6363eb6
perf: adjust the import order to make it more elegant #1537
PanJiaChen Jan 29, 2019
ce35a6f
perf[Sidebar]: use sass variables in vue template
PanJiaChen Jan 29, 2019
bea356a
perf[Style]: optimize the sidebar style to make it better to set (#1568)
PanJiaChen Jan 30, 2019
87f1bbd
perf[SizeSelect]: add default size option (#1566)
PanJiaChen Jan 30, 2019
56bd080
fix[SIdebar]: fixed bug in mobile #1567 (#1569)
PanJiaChen Jan 30, 2019
1e5d2c0
perf: fixed eslint errors
PanJiaChen Feb 1, 2019
e574ca0
perf[Lang]: make up for miss keywords
PanJiaChen Feb 11, 2019
abc8ce2
perf: optimize some code
PanJiaChen Feb 11, 2019
172d6a1
perf[Navbar]: refactor navbar style
PanJiaChen Feb 11, 2019
8e04759
perf[Login]: refine css
PanJiaChen Feb 11, 2019
32b7470
feature[Navbar]: add header-search component(#1591)
PanJiaChen Feb 13, 2019
3cba7b5
fix[Screenfull]: fix screenfull click bug
PanJiaChen Feb 13, 2019
a9fd6e2
perf[Screenfull]: refactor screenfull component
PanJiaChen Feb 13, 2019
e0991da
fix[Screenfull]: fix screenfull bug (#1603)
PanJiaChen Feb 15, 2019
d955fe8
fix typo
PanJiaChen Feb 15, 2019
0410756
fearure[TagsView]: add affix option (#1577)
PanJiaChen Feb 15, 2019
054e9c4
perf[utils]: optimize code
PanJiaChen Feb 19, 2019
5224a00
perf[utils]: optimizate variable name
PanJiaChen Feb 19, 2019
30d4d85
perf[Navbar]: add scroll bar when the subMenu is too long (#1619)
PanJiaChen Feb 21, 2019
2d8a238
perf[ThemePicker]: refine updateStyle function (#554)
Feb 25, 2019
0f3d2bc
perf[ResizeHandler]: optimized the judgment of isMobile (#1633)
PanJiaChen Feb 25, 2019
0bc681e
fix[Sidebar]: fixed infinite loop bug(#1333)
frank10000 Feb 27, 2019
d45e805
fix[Sidebar]: data should return a object
PanJiaChen Feb 27, 2019
8029c07
perf[Sidebar]: optimize code logic (#1349)
AimWhy Feb 28, 2019
c44d001
fix[TagsView]: fixed refresh affixed-tag bug (#1653)
kaisawind Mar 1, 2019
9a5827c
perf[utils.js]: refactor byteLength function (#1650)
mayunhai Mar 4, 2019
6d9ac37
perf[TagsView]: refine code
PanJiaChen Mar 4, 2019
583e96c
perf[TagsView]: set the scrollPane as a business component (#1660)
PanJiaChen Mar 5, 2019
cbc77c9
fix[DragTable]: support multiple drag-table (#1666)
PanJiaChen Mar 6, 2019
5508f05
merge master
PanJiaChen Mar 6, 2019
1877902
refactor(store): add auto import modules
Estelle00 Mar 7, 2019
d7875e2
style: remove;
Estelle00 Mar 7, 2019
9cea0e6
feat: add auto languguage
Estelle00 Mar 7, 2019
f8f7667
perf[Tree-Table]: refactor tree-table
Liugq5713 Mar 7, 2019
fef2853
perf[Tree-Table]: organize the structure and add documentation (#1673)
PanJiaChen Mar 7, 2019
44e4d3d
fix[Sidebar]: fixed nested router hover bug
PanJiaChen Mar 7, 2019
8e0b562
update version
PanJiaChen Mar 8, 2019
3560fca
set preserveWhitespace
PanJiaChen Mar 8, 2019
94a3d7b
lint code
PanJiaChen Mar 8, 2019
2ac4cee
adjust the layout to the src directory
PanJiaChen Mar 9, 2019
1dfea3b
fix jest test case
PanJiaChen Mar 11, 2019
653de1f
update config
PanJiaChen Mar 11, 2019
66e8ca9
bump
PanJiaChen Mar 11, 2019
1d3683a
remove empty file
PanJiaChen Mar 9, 2019
6b74a4e
docs: add link
PanJiaChen Mar 11, 2019
60b4549
fix[Sidebar]: fixed collapse animation problem (#1690)
PanJiaChen Mar 12, 2019
20fdb5c
fix[Tree-Table]: fixed update item data bug (#1692)
Jesonhu Mar 12, 2019
6c1c03c
fix[Waves-Directive]: fixed v-waves does not support update (#1705)
jsjzh Mar 13, 2019
dedf8e7
update husky
PanJiaChen Mar 13, 2019
537ecf9
rm cli-plugin-eslint
PanJiaChen Mar 13, 2019
e855f6a
add settings (#1707)
PanJiaChen Mar 14, 2019
b0e3dc8
refine settings
PanJiaChen Mar 14, 2019
87272fd
fix[utils]: fixed param2Obj not decoding plus sign (#1712)
OtaconBYF Mar 14, 2019
183249a
feature[Directive]: add auto-height table directive (#1702)
yuntao1997 Mar 15, 2019
f175427
fix bug
reuwi Mar 15, 2019
b44335f
feature[Permission]: add role permission management page (#1605)
PanJiaChen Mar 17, 2019
3d973f7
feature[Excel]: support export merged header export (#1718)
llccing Mar 17, 2019
4b5b0a6
feature[Excel]: add export merge header excel demo
PanJiaChen Mar 17, 2019
a80999e
lint
jerecui Mar 17, 2019
f3aefe5
refine theme color
PanJiaChen Mar 18, 2019
05ca5ca
add role mock
PanJiaChen Mar 18, 2019
686d0ac
tweak mock
PanJiaChen Mar 18, 2019
c93d88a
fix[Excel]: fixed export merge-header excel bug
PanJiaChen Mar 18, 2019
8b382e1
refine code
PanJiaChen Mar 18, 2019
6c6f03f
merge
PanJiaChen Mar 18, 2019
27322ac
add ThemePicker to setting
PanJiaChen Mar 19, 2019
9665307
fix[HeaderSearch]: fixed bug in vue2.6+ (#1733)
PanJiaChen Mar 19, 2019
a2b9b37
fix[Sticky]: fixed bug when set stickyTop
Mrli2016 Mar 19, 2019
fd4b5c4
perf[Sticky]: refine demo
PanJiaChen Mar 19, 2019
d927d41
refine code
PanJiaChen Mar 19, 2019
7c33568
tweak mock
PanJiaChen Mar 20, 2019
0c50029
vuex add namespaced
PanJiaChen Mar 20, 2019
fef9fda
fix[Excel]: fixed export bug (#1736)
marxangels Mar 19, 2019
e1d6189
rm
PanJiaChen Mar 20, 2019
0c6e45e
refactor permission
PanJiaChen Mar 21, 2019
59b1493
perf[ThemePicker]: add predefine (#1743)
mayunhai Mar 21, 2019
d1b7869
Merge branch 'master' into v4.0
PanJiaChen Mar 21, 2019
3594052
fix[Utils]: fixed deepClone error msg (#1748)
yugasun Mar 21, 2019
d919acf
feature: add fixedHeader settings
PanJiaChen Mar 21, 2019
ec7c585
fix style in mobile
PanJiaChen Mar 22, 2019
b63c23d
Merge branch 'v4.0' of github.com:PanJiaChen/vue-element-admin into v4.0
Estelle00 Mar 22, 2019
3da179b
Merge pull request #1 from PanJiaChen/master
Estelle00 Apr 2, 2019
8cf632d
Merge branch 'v4.0'
Estelle00 Apr 2, 2019
1a447a2
add to wiki
PanJiaChen Apr 4, 2019
6d63ce1
format
PanJiaChen Apr 4, 2019
3bf66ee
refine
PanJiaChen Apr 4, 2019
0814c3a
doc
PanJiaChen Apr 4, 2019
c1b9a22
refine name
PanJiaChen Apr 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/lang/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,24 @@ const messages = {
...elementEsLocale
}
}
export function getLanguage() {
const chooseLanguage = Cookies.get('language')
if (chooseLanguage) return chooseLanguage

// if has not choose language
const language = (navigator.language || navigator.browserLanguage).toLowerCase()
const locales = Object.keys(messages)
for (const locale of locales) {
if (language.indexOf(locale) > -1) {
return locale
}
}
return 'en'
}
const i18n = new VueI18n({
// set locale
// options: en | zh | es
locale: Cookies.get('language') || 'en',
locale: getLanguage(),
// set locale messages
messages
})
Expand Down
28 changes: 14 additions & 14 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import errorLog from './modules/errorLog'
import permission from './modules/permission'
import tagsView from './modules/tagsView'
import settings from './modules/settings'
import user from './modules/user'
import getters from './getters'

Vue.use(Vuex)

// https://webpack.js.org/guides/dependency-management/#requirecontext
const modulesFiles = require.context('./modules', false, /\.js$/)

// you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
// set './app.js' => 'app'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})

const store = new Vuex.Store({
modules: {
app,
errorLog,
permission,
tagsView,
settings,
user
},
modules,
getters
})

Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Cookies from 'js-cookie'
import { getLanguage } from '@/lang/index'

const state = {
sidebar: {
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
withoutAnimation: false
},
device: 'desktop',
language: Cookies.get('language') || 'en',
language: getLanguage(),
size: Cookies.get('size') || 'medium'
}

Expand Down
1 change: 0 additions & 1 deletion src/store/modules/errorLog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const state = {
logs: []
}
Expand Down
1 change: 0 additions & 1 deletion src/store/modules/tagsView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const state = {
visitedViews: [],
cachedViews: []
Expand Down