Skip to content

Commit

Permalink
Merge pull request #224 from ss1119/feature/#221
Browse files Browse the repository at this point in the history
Feature/#221
  • Loading branch information
ss1119 authored Jan 20, 2023
2 parents e91a7f5 + f644d9d commit 960a01f
Show file tree
Hide file tree
Showing 5 changed files with 10,660 additions and 10,606 deletions.
43 changes: 43 additions & 0 deletions components/layouts/SaveDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<v-dialog :value="open" width="450px" @input="close">
<v-card>
<v-card-title>
{{ cardTitle }}
</v-card-title>

<v-card-text>
<p>{{ cardText }}</p>
</v-card-text>

<v-card-actions>
<v-spacer></v-spacer>
<v-btn text @click="close"> 閉じる </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>

<script>
export default {
name: 'SaveDialog',
props: {
open: {
type: Boolean,
default: false,
required: true,
},
},
data() {
return {
cardTitle: '得点を保存しました',
}
},
methods: {
close() {
this.$emit('close', false)
},
},
}
</script>

<style></style>
3 changes: 2 additions & 1 deletion components/layouts/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Header from './Header'
import NavDrawer from './NavDrawer'
import LogOutDialog from './LogOutDialog'
import SaveDialog from './SaveDialog'

export { Header, NavDrawer, LogOutDialog }
export { Header, NavDrawer, LogOutDialog, SaveDialog }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-prettier-vue": "^3.1.0",
"eslint-plugin-vue": "^7.15.1",
"node-sass": "^4.12.0",
"node-sass": "5.0.0",
"prettier": "^2.3.2",
"sass-loader": "^10.1.1"
}
Expand Down
10 changes: 9 additions & 1 deletion pages/user/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,21 @@

<CardButton :title="btnTitle" :icon="btnIcon" :submit="postPoints" />
</v-card>
<SaveDialog :open="saveConfirm" @close="close" />
</v-row>
</template>

<script>
import { mapGetters } from 'vuex'
import { SaveDialog } from '~/components/layouts/index'
import { CardTitle, CardButton } from '~/components/card/index'
export default {
name: 'UserEdit',
components: {
CardTitle,
CardButton,
SaveDialog,
},
data() {
return {
Expand All @@ -98,6 +101,7 @@ export default {
},
selected: '',
selectItems: ['希望しない', '希望する'],
saveConfirm: false,
}
},
computed: {
Expand Down Expand Up @@ -192,7 +196,7 @@ export default {
point: points,
isGraduate: selected,
})
this.$router.push('/user')
this.saveConfirm = true
} else {
window.scrollTo(0, 0)
}
Expand All @@ -212,6 +216,10 @@ export default {
return re.test(value)
}
},
close() {
this.saveConfirm = false
this.$router.push('/user')
},
},
}
</script>
Expand Down
Loading

0 comments on commit 960a01f

Please sign in to comment.