<template>
  <div class="search-config">
    <div class="config-header">内容</div>
    <div class="confit-item">
      <div class="config-title">
        提示文案
      </div>
      <div class="config-setting">
        <Input v-model="placeholder" class="full-input" @input="change" />
      </div>
    </div>
  </div>
</template>
<script>
import { Input } from 'element-ui'
import { mapState, mapMutations } from 'vuex'
export default {
  components: {
    Input
  },
  computed: {
    ...mapState('creationCamp', [
      'currentComponentKeyCode',
      'currentComponentConfig'
    ]),
    placeholder() {
      return this.currentComponentConfig.placeholder
    }
  },
  methods: {
    ...mapMutations('creationCamp', ['setComponentConfig']),
    change(value) {
      const temporary = {}
      temporary.placeholder = value
      this.setComponentConfig({
        keyCode: this.currentComponentKeyCode,
        content: temporary
      })
    }
  }
}
</script>
