~jiyu/Jiyu-Web

ref: 080fcaf0de1a339fa9062adace83860797e186a5 Jiyu-Web/resources/js/Backend/Components/PageContent.vue -rw-r--r-- 632 bytes
080fcaf0jiyu Made elements draggable 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<template>
    <draggable>
        <template v-for="element in page.content">
            <component
                v-bind:is="element.type + '-element'"
                :element="element"
                :title="element.type == 'title' && page.title"
            >
            </component>
        </template>
    </draggable>
</template>

<script>
    import draggable from 'vuedraggable';
    import Elements from '../Elements';

    export default {
        name: "page-content",
        props: {
            page: Object
        },
        components: {
            ...Elements,
            draggable
        }
    }
</script>