forked from lihongxun945/gobang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfb4f48
commit 75bb246
Showing
9 changed files
with
2,879 additions
and
2,727 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import VueI18n from 'vue-i18n' | ||
import Vue from 'vue' | ||
|
||
import store from '../store/index.js' | ||
|
||
Vue.use(VueI18n) | ||
|
||
const messages = { | ||
en: { | ||
'title': 'Xuanxuan Gobang', | ||
'settings': 'Settings', | ||
'lang': 'Language', | ||
'search deep': 'Search Deep', | ||
'easy': 'Easy', | ||
'normal': 'Normal', | ||
'hard': 'Hard', | ||
'start': 'START', | ||
'give': 'GIVE', | ||
'forward': 'FWD', | ||
'backward': 'BWD', | ||
}, | ||
zh: { | ||
'title': '轩轩五子棋', | ||
'settings': '设置', | ||
'lang': '语言', | ||
'search deep': '思考深度', | ||
'easy': '简单', | ||
'normal': '普通', | ||
'hard': '困难', | ||
'start': '开始', | ||
'give': '认输', | ||
'forward': '前进', | ||
'backward': '后退', | ||
} | ||
} | ||
|
||
export default new VueI18n({ | ||
locale: store.getters.lang, | ||
messages | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
import router from './router' | ||
import store from './store' | ||
import store from './store/index.js' | ||
import './registerServiceWorker' | ||
|
||
import 'weui/dist/style/weui.min.css' | ||
import './reset.scss' | ||
import i18n from './i18n/index.js' | ||
|
||
Vue.config.productionTip = false | ||
|
||
new Vue({ | ||
router, | ||
store, | ||
i18n, | ||
render: h => h(App) | ||
}).$mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select { | ||
text-align-last: right; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex' | ||
|
||
import home from './modules/home.js' | ||
|
||
Vue.use(Vuex) | ||
|
||
export default new Vuex.Store({ | ||
modules: { | ||
home | ||
}, | ||
state: { | ||
|
||
version: "V3.0.0-beta" | ||
}, | ||
mutations: { | ||
|
||
}, | ||
actions: { | ||
|
||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { SET_DEEP, SET_LANG } from '../mutations.js' | ||
|
||
const state = { | ||
lang: 'en', | ||
deep: 6, | ||
deepList: [{ | ||
value: 6, | ||
title: 'easy' | ||
}, { | ||
value: 8, | ||
title: 'normal' | ||
}, { | ||
value: 10, | ||
title: 'hard' | ||
}] | ||
} | ||
|
||
const getters = { | ||
lang: state => state.lang, | ||
deep: state => state.deep, | ||
deepList: state => state.deepList | ||
} | ||
|
||
const mutations = { | ||
[SET_DEEP] (state, deep) { | ||
state.deep = deep | ||
}, | ||
[SET_LANG] (state, lang) { | ||
state.lang = lang | ||
} | ||
} | ||
|
||
const actions = { | ||
[SET_DEEP] ({commit}, deep) { | ||
commit(SET_DEEP, deep) | ||
}, | ||
[SET_LANG] ({commit}, lang) { | ||
commit(SET_LANG, lang) | ||
} | ||
} | ||
|
||
export default { | ||
namespace: true, | ||
state, | ||
getters, | ||
actions, | ||
mutations | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const SET_DEEP = 'SET_DEEP' | ||
export const SET_LANG = 'SET_LANG' |