From a971d0c13ab9cd5107152f6eba5e1e724a37fa0b Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期五, 07 六月 2024 17:20:31 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TCM_CharacterLibrary --- src/uni_modules/luanqing-search/components/luanqing-search/luanqing-search.vue | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/uni_modules/luanqing-search/components/luanqing-search/luanqing-search.vue b/src/uni_modules/luanqing-search/components/luanqing-search/luanqing-search.vue index 43a43f4..50a4572 100644 --- a/src/uni_modules/luanqing-search/components/luanqing-search/luanqing-search.vue +++ b/src/uni_modules/luanqing-search/components/luanqing-search/luanqing-search.vue @@ -1,14 +1,38 @@ <template> <view class="widget_style"> - <view class="ffff" style="display: flex; height: 100%"> + <view class="ffff" style="display: flex; height: 100%; position: relative"> <input placeholder-class="widget_input_placehold" @confirm="onClickSearch" v-model="content" class="widget_input" - :style="style1" + style="min-width: 4rem; padding-right: 54px;box-sizing: border-box;" :placeholder="placehold" /> + <span + class="cleanupBtn" + v-if="content" + @click="content = ''" + style=" + position: absolute; + top: 50%; + margin-top: -10px; + right: 84px; + color: #fff; + z-index: 2; + display: inline-block; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + background-color: #a5a5a5; + font-weight: bold; + border-radius: 50%; + font-size: 12px; + cursor: pointer; + " + >鉁�</span + > <view class="widget_button" v-if="isSearchTrue" @click="onClickSearch">{{ buttonText }}</view> @@ -22,7 +46,6 @@ data() { return { content: "", - style1: "", style2: "" }; }, @@ -53,9 +76,7 @@ }, created() { // 缂栫粐璁剧疆鍔ㄦ�佸搴� - // this.style1 = 'min-width:calc('+this.width+'vw);'; // this.style2 = 'min-width:calc('+(this.width / 5)+'vw);'; - this.style1 = "width:4.5rem"; this.style2 = "width:.5rem"; this.content = this.keyword || ""; }, @@ -65,11 +86,11 @@ this.$emit("onSearch", { text: this.content }); } }, - watch: { - keyword(value) { - this.content = value - } - } + watch: { + keyword(value) { + this.content = value; + } + } }; </script> -- Gitblit v1.9.1