Commit 7deb144d by amateur

代码修改

1 parent 44351acb
......@@ -105,7 +105,7 @@ export default {
directives: {
wrap: {
inserted: function (el, binding, vnode, oldVnode) {
setTimeout(() => {
// setTimeout(() => {
const { arg, value } = binding
const style = { width: 0, height: 0 }
for (let i = 0; i < el.childNodes.length; i++) {
......@@ -127,7 +127,7 @@ export default {
style.width && (el.style.width = `${style.width}px`)
style.height && (el.style.height = `${style.height}px`)
}, 0);
// }, 0);
}
}
}
......
<template>
<form action="/">
<form action="javascript:return true">
<van-search class="common_search" v-model="searchValue" v-on="$listeners" v-bind="$attrs" />
</form>
</template>
......@@ -13,21 +13,21 @@ export default {
model: {
prop: ['keyword']
},
data() {
data () {
return {
searchValue: ''
}
},
watch: {
searchValue(val) {
searchValue (val) {
this.$emit('input', val)
},
keyword(val) {
keyword (val) {
this.searchValue = val
}
}
}
</script>
<style lang="less" scoped>
@import "~@/assets/css/search.less";
@import '~@/assets/css/search.less';
</style>
\ No newline at end of file
......@@ -22,9 +22,16 @@ export default {
},
data () {
return {
keyword: this.defKeyword,
keyword: ''
}
},
watch: {
defKeyword (val, old) {
this.keyword = val
}
},
methods: {
handleSearch (val) {
this.$store.dispatch('search/APushHomeSearchValue', val)
......@@ -34,6 +41,9 @@ export default {
emitSearchValue (val) {
this.$emit('search', val)
}
},
mounted () {
// this.keyword = this.defKeyword
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!