<!-- webview only --><!-- slot -->
<template>
    <span @click.capture="$emit('click', $event)" @touchstart.capture="$emit('touchstart', $event)" @touchmove.capture="$emit('touchmove', $event)" @touchend.capture="$emit('touchend', $event)" @touchcancel.capture="$emit('touchcancel', $event)">
        <slot></slot>
    </span>
</template>

<script>
export default {
    name: 'BText',
    props: {
        selectable: {
            type: Boolean,
            default: false,
        },
        space: {
            type: String,
            default: 'false'
        },
        decode: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            html: '',
        }
    },
    created() {
        // this.$slots.default.forEach((item) => {
        //     console.log(item.text);
        // });
    },
    mounted() {
        // [...this.$el.childNodes].forEach((node) => {
        //     if (node.nodeType === 3) {
        //         if (this.space !== 'false') {
        //             node.nodeValue = node.nodeValue.replace(/ /g, `&${this.space};`);
        //         }
        //     }
        // });
        // console.log('mount', this.$el.childNodes);
    },
    updated() {
        // console.log('update', this.$slots);
    }
}
</script>

<style lang="less" scoped>
span {
    white-space: pre-line;
}
</style>
