選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

listViewControl.vue 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div class="container">
  3. <div class="offset-3 col-md-6">
  4. <input v-model="searchItem" class="form-control" placeholder="Search...." />
  5. </div>
  6. <hr />
  7. <div class="row">
  8. <div v-for="item in items" :key="item" class="col-md-4">
  9. <div :class="{'inSearch': isInSelected(item)}">
  10. <CheckItem :title="item.column" :show="item.show" @checkItem="checkItem" />
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import CheckItem from "./checkItem.vue";
  18. export default {
  19. components: {
  20. CheckItem
  21. },
  22. data() {
  23. return {
  24. searchItem: undefined
  25. };
  26. },
  27. props: {
  28. items: undefined
  29. },
  30. methods: {
  31. isInSelected(i) {
  32. if (this.searchItem && this.searchItem.length > 0) {
  33. return (
  34. i.column.toLowerCase().indexOf(this.searchItem.toLowerCase()) > -1
  35. );
  36. }
  37. return false;
  38. },
  39. checkItem(column, show) {
  40. this.$emit("checkItem", column, show);
  41. }
  42. },
  43. computed: {}
  44. };
  45. </script>
  46. <style>
  47. .inSearch {
  48. border: 1px solid rgba(50, 50, 50, 0.5);
  49. border-radius: 10px;
  50. background-color: rgba(225, 225, 225, 0.6);
  51. }
  52. </style>