<template>
    <div class="random">
        <random-option @query="handleQuery"></random-option>
        <random-table ref="table"></random-table>
    </div>
</template>

<script>
import RandomOption from './component/RandomOption.vue'
import RandomTable from './component/RandomTable.vue'

export default {
    components: {
        RandomOption,
        RandomTable
    },
    methods: {
        resetForm() {
            if (this.$refs.table) {
                this.$refs.table.resetForm()
            }
        },
        handleQuery(data) {
            if (this.$refs.table) {
                this.$refs.table.resetForm(data)
            }
        }
    }
}
</script>