Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(search):using prefix in classname #54

Merged
merged 2 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ const name = `${prefix}-search`;

@wxComponent()
export default class Search extends SuperComponent {
externalClasses = ['t-class', 't-class-input', 't-class-cancel', 't-class-left', 't-class-right'];
externalClasses = [
`${prefix}-class`,
`${prefix}-class-input`,
`${prefix}-class-cancel`,
`${prefix}-class-left`,
`${prefix}-class-right`,
];

options = {
multipleSlots: true,
Expand Down
14 changes: 7 additions & 7 deletions src/search/search.wxml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<view class="{{classPrefix}} t-class">
<view class="{{classPrefix}} {{prefix}}-class">
<view
class="{{classPrefix}}__input-box {{prefix}}-{{localValue.focus ? 'is-focused' : 'not-focused'}} {{classPrefix}}__input-box--{{center && !localValue.keyword && 'center'}} {{classPrefix}}__input-box--{{shape}} "
bind:tap="tapWhenCenterActiveHandle"
>
<view wx:if="{{ label }}" class="{{classPrefix}}__label t-class-label">{{ label }}</view>
<view wx:if="{{label}}" class="{{classPrefix}}__label {{prefix}}-class-label"> {{label}} </view>
<slot wx:else name="label" />

<t-icon
wx:if=" {{ leftIcon }}"
wx:if="{{leftIcon}}"
name="{{leftIcon}}"
size="20px"
class="{{prefix}}-icon t-class-left"
class="{{prefix}}-icon {{prefix}}-class-left"
>
</t-icon>
<slot wx:else name="left-icon" />
Expand All @@ -26,7 +26,7 @@
type="text"
name="input"
disabled="{{disabled}}"
class="{{prefix}}-input__keyword t-class-input"
class="{{prefix}}-input__keyword {{prefix}}-class-input"
focus="{{localValue.focus}}"
value="{{localValue.keyword}}"
confirm-type="search"
Expand All @@ -40,7 +40,7 @@
<block wx:if="{{localValue.keyword!=='' && (!center || focus)}}">
<t-icon
wx:if="{{rightIcon}}"
class="{{prefix}}-icon t-class-right"
class="{{prefix}}-icon {{prefix}}-class-right"
name="{{rightIcon}}"
size="18px"
color="rgba(187,187,187,1)"
Expand All @@ -53,7 +53,7 @@

<view
wx:if="{{actionText}}"
class="{{classPrefix}}__search-action t-class-cancel"
class="{{classPrefix}}__search-action {{prefix}}-class-cancel"
bindtap="onCancel"
>
{{actionText}}
Expand Down