index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="position-nav" :style="'background:' + bg">
  3. <div class="icon">
  4. <i class="iconfont icon-dingwei"></i>
  5. </div>
  6. <div class="inp">
  7. <input
  8. :style="'background:' + bg"
  9. type="text"
  10. v-model="address"
  11. @change="valueChange"
  12. />
  13. </div>
  14. <!-- <div class="right">导航</div>-->
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. address: {
  21. type: String,
  22. default: "",
  23. },
  24. bg: {
  25. type: String,
  26. default: "#f8f8f8",
  27. },
  28. },
  29. data() {
  30. return {
  31. show: "",
  32. };
  33. },
  34. mounted() {
  35. this.show = this.address;
  36. },
  37. methods: {
  38. valueChange() {
  39. this.$emit("childByValue", this.address);
  40. },
  41. },
  42. };
  43. </script>
  44. <style lang="scss" type="text/scss" scoped>
  45. .position-nav {
  46. display: flex;
  47. padding: 0 30rpx;
  48. justify-content: space-between;
  49. align-items: center;
  50. border-radius: 70rpx;
  51. box-shadow: 0px 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.12);
  52. height: 70px;
  53. .icon {
  54. width: 120rpx;
  55. text-align: center;
  56. i {
  57. font-size: 72rpx;
  58. // color: $color2;
  59. }
  60. }
  61. .inp {
  62. width: 470px;
  63. input {
  64. width: 100%;
  65. line-height: 72rpx;
  66. font-size: 52rpx;
  67. // color: $color4;
  68. }
  69. }
  70. .right {
  71. width: 100px;
  72. border-left: 1px solid black;
  73. font-size: 52rpx;
  74. // color: $text7;
  75. text-align: center;
  76. }
  77. }
  78. </style>