<template>
    <div class="oText" v-if="widget.type == 'text'">
        <p class="text-content" :class="[preview ? 'textMarginTop' : null]">{{ dataModel }}</p>
    </div>
</template>
<script>

export default {
    name: 'oText',
    props: ['widget', 'preview'],
    data() {
        return {
            dataModel: this.widget.options?.defaultValue || null,
        }
    },
    mounted() {
        // 初始化参数
    },
    methods: {
    },
    computed: {
        options() {
            return this.widget.options || {}
        },
    },
    watch: {
        // dataModel: {
        //     deep: true,
        //     handler(newValue) {
        //         if (newValue !== undefined && newValue !== null) {
        //         }
        //     }
        // },
    }
}
</script>

<style lang='less' scoped>
.oText {
    // margin-bottom: 5px;
    padding: 12px 0 5px;
    .text-content {
        font-size: .12rem;
        color: #777777;
        padding: 0 .16rem;
        &.textMarginTop {
            margin-top: 5px;
            // padding: 0;
        }
    }
}
</style>