mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
删除无用文件夹
This commit is contained in:
84
wechat/miniprogram_npm/@vant/weapp/search/index.js
Normal file
84
wechat/miniprogram_npm/@vant/weapp/search/index.js
Normal file
@@ -0,0 +1,84 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
var version_1 = require('../common/version');
|
||||
component_1.VantComponent({
|
||||
field: true,
|
||||
classes: ['field-class', 'input-class', 'cancel-class'],
|
||||
props: {
|
||||
label: String,
|
||||
focus: Boolean,
|
||||
error: Boolean,
|
||||
disabled: Boolean,
|
||||
readonly: Boolean,
|
||||
inputAlign: String,
|
||||
showAction: Boolean,
|
||||
useActionSlot: Boolean,
|
||||
useLeftIconSlot: Boolean,
|
||||
useRightIconSlot: Boolean,
|
||||
leftIcon: {
|
||||
type: String,
|
||||
value: 'search',
|
||||
},
|
||||
rightIcon: String,
|
||||
placeholder: String,
|
||||
placeholderStyle: String,
|
||||
actionText: {
|
||||
type: String,
|
||||
value: '取消',
|
||||
},
|
||||
background: {
|
||||
type: String,
|
||||
value: '#ffffff',
|
||||
},
|
||||
maxlength: {
|
||||
type: Number,
|
||||
value: -1,
|
||||
},
|
||||
shape: {
|
||||
type: String,
|
||||
value: 'square',
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onChange: function (event) {
|
||||
if (version_1.canIUseModel()) {
|
||||
this.setData({ value: event.detail });
|
||||
}
|
||||
this.$emit('change', event.detail);
|
||||
},
|
||||
onCancel: function () {
|
||||
var _this = this;
|
||||
/**
|
||||
* 修复修改输入框值时,输入框失焦和赋值同时触发,赋值失效
|
||||
* https://github.com/youzan/@vant/weapp/issues/1768
|
||||
*/
|
||||
setTimeout(function () {
|
||||
if (version_1.canIUseModel()) {
|
||||
_this.setData({ value: '' });
|
||||
}
|
||||
_this.$emit('cancel');
|
||||
_this.$emit('change', '');
|
||||
}, 200);
|
||||
},
|
||||
onSearch: function (event) {
|
||||
this.$emit('search', event.detail);
|
||||
},
|
||||
onFocus: function (event) {
|
||||
this.$emit('focus', event.detail);
|
||||
},
|
||||
onBlur: function (event) {
|
||||
this.$emit('blur', event.detail);
|
||||
},
|
||||
onClear: function (event) {
|
||||
this.$emit('clear', event.detail);
|
||||
},
|
||||
onClickInput: function (event) {
|
||||
this.$emit('click-input', event.detail);
|
||||
},
|
||||
},
|
||||
});
|
||||
6
wechat/miniprogram_npm/@vant/weapp/search/index.json
Normal file
6
wechat/miniprogram_npm/@vant/weapp/search/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-field": "../field/index"
|
||||
}
|
||||
}
|
||||
51
wechat/miniprogram_npm/@vant/weapp/search/index.wxml
Normal file
51
wechat/miniprogram_npm/@vant/weapp/search/index.wxml
Normal file
@@ -0,0 +1,51 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view
|
||||
class="{{ utils.bem('search', { withaction: showAction || useActionSlot }) }} custom-class"
|
||||
style="background: {{ background }}"
|
||||
>
|
||||
<view class="{{ utils.bem('search__content', [shape]) }}">
|
||||
<view class="van-search__label" wx:if="{{ label }}">{{ label }}</view>
|
||||
<slot wx:else name="label" />
|
||||
|
||||
<van-field
|
||||
type="search"
|
||||
left-icon="{{ !useLeftIconSlot ? leftIcon : '' }}"
|
||||
right-icon="{{ !useRightIconSlot ? rightIcon : '' }}"
|
||||
focus="{{ focus }}"
|
||||
error="{{ error }}"
|
||||
border="{{ false }}"
|
||||
confirm-type="search"
|
||||
class="van-search__field field-class"
|
||||
value="{{ value }}"
|
||||
disabled="{{ disabled }}"
|
||||
readonly="{{ readonly }}"
|
||||
clearable="{{ clearable }}"
|
||||
maxlength="{{ maxlength }}"
|
||||
input-align="{{ inputAlign }}"
|
||||
input-class="input-class"
|
||||
placeholder="{{ placeholder }}"
|
||||
placeholder-style="{{ placeholderStyle }}"
|
||||
custom-style="padding: 5px 10px 5px 0; background-color: transparent;"
|
||||
bind:blur="onBlur"
|
||||
bind:focus="onFocus"
|
||||
bind:change="onChange"
|
||||
bind:confirm="onSearch"
|
||||
bind:clear="onClear"
|
||||
bind:click-input="onClickInput"
|
||||
>
|
||||
<slot wx:if="{{ useLeftIconSlot }}" name="left-icon" slot="left-icon" />
|
||||
<slot wx:if="{{ useRightIconSlot }}" name="right-icon" slot="right-icon" />
|
||||
</van-field>
|
||||
</view>
|
||||
|
||||
<view
|
||||
wx:if="{{ showAction || useActionSlot }}"
|
||||
class="van-search__action"
|
||||
hover-class="van-search__action--hover"
|
||||
hover-stay-time="70"
|
||||
>
|
||||
<slot wx:if="{{ useActionSlot }}" name="action" />
|
||||
<view wx:else bind:tap="onCancel" class="cancel-class">{{ actionText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
1
wechat/miniprogram_npm/@vant/weapp/search/index.wxss
Normal file
1
wechat/miniprogram_npm/@vant/weapp/search/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-search{display:flex;align-items:center;box-sizing:border-box;padding:10px 12px;padding:var(--search-padding,10px 12px)}.van-search__content{display:flex;flex:1;padding-left:12px;padding-left:var(--padding-sm,12px);border-radius:2px;border-radius:var(--border-radius-sm,2px);background-color:#f7f8fa;background-color:var(--search-background-color,#f7f8fa)}.van-search__content--round{border-radius:999px;border-radius:var(--border-radius-max,999px)}.van-search__label{padding:0 5px;padding:var(--search-label-padding,0 5px);font-size:14px;font-size:var(--search-label-font-size,14px);line-height:34px;line-height:var(--search-input-height,34px);color:#323233;color:var(--search-label-color,#323233)}.van-search__field{flex:1}.van-search__field__left-icon{color:#969799;color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{padding:0 8px;padding:var(--search-action-padding,0 8px);font-size:14px;font-size:var(--search-action-font-size,14px);line-height:34px;line-height:var(--search-input-height,34px);color:#323233;color:var(--search-action-text-color,#323233)}.van-search__action--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}
|
||||
Reference in New Issue
Block a user