<template>
  <div id="search">
    <el-input placeholder="请输入名称" v-model="input" class="input-with-select" clearable>
      <el-button slot="append" icon="el-icon-search" @click="searchData()"></el-button>
    </el-input>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'search',
  components: {},
  data: function () {
    return {
      input: undefined,
    };
  },
  created() {},
  methods: {
    searchData() {
      this.$emit('toSearch', !this.input ? undefined : this.input);
    },
  },
  computed: {
    ...mapState(['user', 'menuParams']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped></style>
