forked from Tencent/tdesign-miniprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
148 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Component({ | ||
methods: { | ||
handleClick(e) { | ||
console.log(e); | ||
}, | ||
handleMove(e) { | ||
console.log(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-fab": "tdesign-miniprogram/fab/fab" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<t-fab | ||
icon="gesture-press" | ||
text="拖我" | ||
bind:click="handleClick" | ||
bind:move="handleMove" | ||
aria-label="增加" | ||
movable="{{true}}" | ||
></t-fab> |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<import src="../common/template/button.wxml" /> | ||
<template | ||
is="button" | ||
data="{{ ...baseButtonProps, icon, ...buttonProps, externalClass: prefix + '-fab__button', content: text, ariaLabel}}" | ||
/> |
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,12 +1,24 @@ | ||
<import src="../common/template/button.wxml" /> | ||
<wxs src="../common/utils.wxs" module="_" /> | ||
|
||
<view | ||
class="{{classPrefix}} class {{prefix}}-class" | ||
style="right: 16px; bottom: 32px; {{_._style([style, customStyle])}}" | ||
> | ||
<template | ||
is="button" | ||
data="{{ ...baseButtonProps, icon, ...buttonProps, externalClass: prefix + '-fab__button', content: text, ariaLabel}}" | ||
/> | ||
<view> | ||
<view | ||
wx:if="{{!movable}}" | ||
class="{{classPrefix}} class {{prefix}}-class" | ||
style="right: {{defRight}}px; bottom: {{defBottom}}px; {{_._style([style, customStyle])}}" | ||
> | ||
<include src="./fab-button.wxml" /> | ||
</view> | ||
<movable-area wx:else class="{{classPrefix}}-movable_area" style="{{_._style([style, customStyle])}}"> | ||
<movable-view | ||
class="{{classPrefix}}-movable_view" | ||
direction="{{baseMovableViewProps.direction}}" | ||
inertia="{{baseMovableViewProps.inertia}}" | ||
x="{{baseMovableViewProps.x === undefined ? movableViewX : baseMovableViewProps.x}}" | ||
y="{{baseMovableViewProps.y === undefined ? movableViewY : baseMovableViewProps.y}}" | ||
disabled="{{baseMovableViewProps.disabled}}" | ||
bindchange="movableViewMove" | ||
> | ||
<include src="./fab-button.wxml" /> | ||
</movable-view> | ||
</movable-area> | ||
</view> |
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