index.vue 814 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div class="select1">
  3. <p>{{title}}</p>
  4. <el-select v-model="result" clearable placeholder="请选择" size="small" @change="change" width="100px">
  5. <el-option
  6. v-for="item in list"
  7. :key="item.value"
  8. :label="item.label"
  9. :value="item.value">
  10. </el-option>
  11. </el-select>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: '',
  17. data() {
  18. return {
  19. result:''
  20. };
  21. },
  22. props:['title','list'],
  23. computed:{
  24. },
  25. watch:{
  26. },
  27. methods: {
  28. change() {
  29. this.$emit('selectChange',this.result)
  30. }
  31. },
  32. };
  33. </script>
  34. <style scoped>
  35. .select1 {
  36. display: flex;
  37. align-items: center;
  38. }
  39. p {
  40. margin-right: 8px;
  41. font-size: 14px;
  42. color: #666666;
  43. }
  44. /deep/.el-select {
  45. width: 150px !important;
  46. }
  47. </style>