提交 27b4fa3b authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 a2df94dc
...@@ -29,10 +29,8 @@ export default { ...@@ -29,10 +29,8 @@ export default {
data() { data() {
const UA = window.navigator.userAgent const UA = window.navigator.userAgent
const isMobile = /android|iphone|ipad|ipod/i.test(UA) const isMobile = /android|iphone|ipad|ipod/i.test(UA)
return { const voteApply = window.localStorage.getItem('voteApply')
isMobile, const defaultModel = {
applyCityList: [],
formModel: {
vote_city: '', vote_city: '',
vote_config_id: '', vote_config_id: '',
name: '', name: '',
...@@ -48,6 +46,10 @@ export default { ...@@ -48,6 +46,10 @@ export default {
recommend: '', recommend: '',
photo: '' photo: ''
} }
return {
isMobile,
applyCityList: [],
formModel: Object.assign(defaultModel, JSON.parse(voteApply))
} }
}, },
watch: { watch: {
...@@ -266,10 +268,6 @@ export default { ...@@ -266,10 +268,6 @@ export default {
} }
}, },
beforeMount() { beforeMount() {
const voteApply = window.localStorage.getItem('voteApply')
if (voteApply) {
this.formModel = Object.assign(this.formModel, JSON.parse(voteApply))
}
this.getApplyCity() this.getApplyCity()
}, },
beforeCreate() { beforeCreate() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论