<template>
    <div class="oDivider" :class="[preview ? '' : 'o-unit']" v-if="widget.type == 'divider'">
        <van-divider
            :style="{ borderColor: '#c0c0c0', padding: '0 16px', margin: 0 }"
            v-if="!preview"
            :content-position="options.content_position">{{ dataModel }}</van-divider>
        <van-divider
            :style="{ borderColor: '#c0c0c0', margin: 0 }"
            v-else
            :content-position="options.content_position">{{ dataModel }}</van-divider>
    </div>
</template>
<script>

export default {
    name: 'oDivider',
    props: ['widget', 'preview'],
    data() {
        return {
            dataModel: this.widget.options?.defaultValue || null,
        }
    },
    mounted() {
        // 初始化参数
    },
    methods: {
    },
    computed: {
        options() {
            return this.widget.options || {}
        },
    }
}
</script>

<style lang='less' scoped>
.o-unit {
    margin-bottom: 12px;
}
</style>