import { defineComponent } from 'vue';
import styles from './index.module.less';
import { NInput } from 'naive-ui';

export default defineComponent({
  name: 'student-studentList',
  props: ['searchWord'],
  emits: ['changeValue', 'keyup', 'clear'],
  setup(props, { emit, attrs }) {
    return () => (
      <div>
        <NInput
          {...attrs}
          clearable
          class={styles.searchInput}
          v-slots={{
            prefix: () => <span class={'icon-search-input'}></span>
          }}
          value={props.searchWord}
          onInput={(str: string) => {
            emit('changeValue', str);
          }}
          onClear={() => emit('clear')}
          onKeyup={(e: KeyboardEvent) => emit('keyup', e)}></NInput>
      </div>
    );
  }
});
