1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <div class="build_input">
- <i class="iconfont icon-sousuo"></i>
- <input type="text" v-model="value" :placeholder="placeholder" @keyup.enter="search">
- </div>
- </template>
- <script>
- export default {
- props: [ 'placeholder'],
- data(){
- return{
- value: ''
- }
- },
- methods: {
- search(){
- this.$emit("search",this.value)
- },
- },
- }
- </script>
- <style lang="less" scoped>
- .build_input{
- display: inline-block;
- width: 23rem;
- height: 2rem;
- line-height: 2rem;
- font-size: 1.4rem;
- position: relative;
- input{
- width: 100%;
- height: 100%;
- padding-left: 2rem;
- font-size: .8rem;
- box-sizing: border-box;
- }
- .icon-sousuo{
- position: absolute;
- width: 2rem;
- height: 2rem;
- left: 0;
- top: 3px;
- bottom: 0;
- line-height: 2rem;
- text-align: center;
- }
- }
- </style>
|