forked from TDesignOteam/tdesign-miniprogram-starter-apply
-
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
1 parent
c8e08bd
commit 4a5cf03
Showing
8 changed files
with
397 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// pages/home/components/popupButton/index.js | ||
Component({ | ||
/** | ||
* 组件的属性列表 | ||
*/ | ||
properties: { | ||
"text": { | ||
"type": String, | ||
"value": '分类内容' | ||
}, | ||
"reset": { | ||
"type": Boolean, | ||
"value": false, | ||
"observer": "statusReset" | ||
} | ||
}, | ||
|
||
/** | ||
* 组件的初始数据 | ||
*/ | ||
data: { | ||
chosen: false | ||
}, | ||
|
||
/** | ||
* 组件的方法列表 | ||
*/ | ||
methods: { | ||
handleClick() { | ||
let newStatus = !this.data.chosen; | ||
this.setData({ | ||
chosen: newStatus | ||
}) | ||
|
||
this.triggerEvent('clickBtn', newStatus ? { | ||
chosen: true, | ||
tag: this.properties.text | ||
} : { | ||
chosen: false, | ||
tag: this.properties.text | ||
}) | ||
}, | ||
statusReset(){ | ||
this.setData({ | ||
chosen: false | ||
}) | ||
this.triggerEvent('finshReset'); | ||
} | ||
} | ||
}) |
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,4 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": {} | ||
} |
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,24 @@ | ||
/* pages/home/components/popupButton/index.wxss */ | ||
.btn { | ||
display: inline-flex; | ||
width: 28.3vw; | ||
height: 4.9vh; | ||
border-radius: 100px; | ||
background: #f3f3f3; | ||
font-size: 1.7vh; | ||
font-weight: 400; | ||
font-family: "PingFang SC"; | ||
line-height: 22px; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.normal { | ||
color: #000000e6; | ||
} | ||
|
||
.chosen { | ||
color: #0052d9; | ||
border: 1px solid #0052d9; | ||
background: #f2f3ff; | ||
} |
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,4 @@ | ||
<!--pages/home/components/popupButton/index.wxml--> | ||
<button class="btn {{ chosen ? 'chosen' : 'normal'}}" bindtap="handleClick"> | ||
{{ text }} | ||
</button> |
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
Oops, something went wrong.