<script setup lang="ts">
import { Events } from '~/dim/event'
const emit = defineEmits([Events.input, Events.change])
const options = [
{
  value:'0',
  text:'Default'
},{
  value:'1',
  text:'Price'
},{
  value:'2',
  text:'Stock'
},{
  value:'3',
  text:'Sales'
}]

function handleChange(val: any) {
  emit(Events.input, val)
  emit(Events.change, val)
}
</script>

<template>
  <el-select filterable placeholder="Sort" @change="handleChange">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.text"
      :value="item.value"
    >
      <span style="float: left">{{ item.text }}</span>
    </el-option>
  </el-select>
</template>
