12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- // components/pop/pop.js
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- show: {
- type: Boolean,
- value: false
- }
- },
- observers: {
- 'show': function (show) {
- let that = this
- if (show) {
- that.open()
- } else {
- that.close()
- }
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- showPop: false,
- animation: ""
- },
- /**
- * 组件的方法列表
- */
- methods: {
- none() {
- return
- },
- open() {
- let that = this
- that.setData({
- showPop: true
- })
- setTimeout(() => {
- that.setData({
- animation: "active"
- })
- }, 50);
- },
- close() {
- let that = this
- that.setData({
- animation: ""
- })
- setTimeout(() => {
- that.setData({
- showPop: false
- })
- }, 350);
- },
- closeEvent() {
- let that = this
- that.triggerEvent('close', false)
- }
- }
- })
|