<template>
    <view class="form_select_to_page" @click="handleClickToPage">
        <view>{{ val }}</view>
        <u-icon size="13" name="close-circle" @click="clear" v-if="val"></u-icon>
        <u-icon size="20" name="arrow-right"></u-icon>
    </view>
</template>
<script>
export default {
    components: {
    },
    props: {
        val: {
            type: String || Number,
            default: '' || null,
        },
        url: {
            type: String,
            default: '',
        }
    },
    emits: ['handleClear'],
    data() {
        return {

        }
    },
    methods: {
        clear(){
            console.log(this.val);
            this.$emit('handleClear');
        },
        handleClickToPage(){
            uni.navigateTo({
                url: this.url
            })
        }
    }
}
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>