-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GuideTour、Tabbar、Picker、DatePicker、Selector、Checkbox controlled (…
…#379) Co-authored-by: wyj <wb-wyj631405@antfin.com>
- Loading branch information
1 parent
9b40e6e
commit caa54f6
Showing
57 changed files
with
374 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<view class="demo"> | ||
<demo-block title="基础用法"> | ||
<view class="btn-list"> | ||
<button onTap="openBaseTour">单图模式</button> | ||
<button onTap="openMoreTour">多图模式</button> | ||
<button onTap="openSwiperTour">滑动模式</button> | ||
<container title="基础用法"> | ||
<view class="btn-list"> | ||
<button onTap="openBaseTour">单图模式</button> | ||
<button onTap="openMoreTour">多图模式</button> | ||
<button onTap="openSwiperTour">滑动模式</button> | ||
</view> | ||
<guide-tour items="{{[list[0]]}}" visible="{{baseVisible}}" onCancel="closeBaseTour" onChange="onChange" /> | ||
<guide-tour items="{{list}}" visible="{{moreVisible}}" onCancel="closeMoreTour" onChange="onChange" /> | ||
<guide-tour items="{{list}}" visible="{{swiperVisible}}" onCancel="closeSwiperTour" onChange="onChange" | ||
swiperable="{{true}}" /> | ||
</container> | ||
<container title="插槽用法"> | ||
<button onTap="openSlotTour">开始</button> | ||
<guide-tour items="{{list}}" visible="{{slotVisible}}" onCancel="closeSlotTour" onChange="onChange"> | ||
<view class="step-box" slot="step" slot-scope="props"> | ||
step-{{props.index}} | ||
</view> | ||
<guide-tour steps="{{[list[0]]}}" visible="{{baseVisible}}" onCancel="closeBaseTour" onChange="onChange" /> | ||
<guide-tour steps="{{list}}" visible="{{moreVisible}}" onCancel="closeMoreTour" onChange="onChange" /> | ||
<guide-tour steps="{{list}}" visible="{{swiperVisible}}" onCancel="closeSwiperTour" onChange="onChange" | ||
swiperable="{{true}}" /> | ||
</demo-block> | ||
<demo-block title="插槽用法"> | ||
<button onTap="openSlotTour">开始</button> | ||
<guide-tour steps="{{list}}" visible="{{slotVisible}}" onCancel="closeSlotTour" onChange="onChange"> | ||
<view class="step-box" a:for="{{list}}" slot="step-{{index}}"> | ||
step-{{index}} | ||
</view> | ||
</guide-tour> | ||
</demo-block> | ||
</view> | ||
</guide-tour> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
<input | ||
placeholder="请输入内容" | ||
allowClear | ||
/> | ||
> | ||
</input> | ||
</container> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +0,0 @@ | ||
page { | ||
padding: 12px; | ||
} | ||
|
||
page .amd-container { | ||
margin-bottom: 12px; | ||
} | ||
|
||
.valueBox { | ||
margin-top: 24rpx; | ||
} | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const CheckboxGroupDefaultProps = { | ||
options: [], | ||
position: 'vertical', | ||
defaultValue: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import { CheckboxDefaultProps } from './props'; | ||
import fmtEvent from '../_util/fmtEvent'; | ||
import mixinValue from '../mixins/value'; | ||
|
||
Component({ | ||
props: CheckboxDefaultProps, | ||
data: { | ||
selfChecked: undefined, | ||
}, | ||
mixins: [ | ||
mixinValue({ | ||
valueKey: 'checked', | ||
defaultValueKey: 'defaultChecked', | ||
}), | ||
], | ||
methods: { | ||
onChange(e) { | ||
const value = e.detail.value; | ||
if (typeof this.props.checked === 'undefined') { | ||
this.setData({ | ||
selfChecked: value, | ||
}); | ||
const value = !this.getValue(); | ||
if (!this.isControlled()) { | ||
this.update(value); | ||
} | ||
if (this.props.onChange) { | ||
this.props.onChange(value, fmtEvent(this.props, e)); | ||
} | ||
} | ||
} | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.