SearchInput.vue
569 Bytes
<template>
<form action="javascript:return true">
<van-search class="common_search" v-model="searchValue" v-on="$listeners" v-bind="$attrs" />
</form>
</template>
<script>
export default {
name: 'SearchInput',
props: {
keyword: String
},
model: {
prop: ['keyword']
},
data () {
return {
searchValue: ''
}
},
watch: {
searchValue (val) {
this.$emit('input', val)
},
keyword (val) {
this.searchValue = val
}
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/css/search.less';
</style>