|
@@ -7,15 +7,24 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import EditorVue from '../../components/editor/Editor.vue'
|
|
import EditorVue from '../../components/editor/Editor.vue'
|
|
|
-import { updateSlide } from '../../server/slide'
|
|
|
|
|
-import { DIFF } from '../../store/types/editor-types'
|
|
|
|
|
|
|
+import { updateSlide, getSlide } from '../../server/slide'
|
|
|
|
|
+import { DIFF, INIT_BY_STATE } from '../../store/types/editor-types'
|
|
|
import { mapState } from 'vuex'
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: { EditorVue },
|
|
components: { EditorVue },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ slideId: this.$route.params.id
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ getSlide(this.slideId).then(res => {
|
|
|
|
|
+ this.$store.commit(INIT_BY_STATE, res)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
save() {
|
|
save() {
|
|
|
- console.log(this.$store.state.editor.slideInfo)
|
|
|
|
|
updateSlide(
|
|
updateSlide(
|
|
|
this.$store.state.editor.slideInfo,
|
|
this.$store.state.editor.slideInfo,
|
|
|
this.$store.state.editor.items
|
|
this.$store.state.editor.items
|