12345678910111213141516171819202122232425262728 |
- "use strict";
- Component({
- props: {
- hidden: true,
- duration: 1500,
- textContent: '',
- onLoadChange: function onLoadChange() {}
- },
- methods: {
- watchHidden: function watchHidden() {
- var num = Number(this.props.duration);
- if (!this.props.hidden) {
- var that = this;
- setTimeout(function () {
- var e = {
- type: 'change'
- };
- that.props.onLoadChange(e);
- }, num);
- }
- }
- },
- didUpdate: function didUpdate() {
- this.watchHidden();
- }
- });
|