{"size": 833, "ext": "js", "max_stars_repo_path": "components/backdrop/backdrop.js", "max_stars_repo_name": "jphome/Brickmove-Show", "max_stars_repo_stars_event_min_datetime": "2018-07-25T10:04:12.000Z", "max_stars_repo_stars_event_max_datetime": "2018-07-25T10:04:12.000Z", "max_issues_repo_path": "components/backdrop/backdrop.js", "max_issues_repo_name": "jphome/Brickmove-Show", "max_issues_repo_issues_event_min_datetime": "2019-01-14T17:56:23.000Z", "max_issues_repo_issues_event_max_datetime": "2019-11-17T15:39:23.000Z", "max_forks_repo_path": "components/backdrop/backdrop.js", "max_forks_repo_name": "jphome/Brickmove-Show", "max_forks_repo_forks_event_min_datetime": "2018-07-26T00:50:10.000Z", "max_forks_repo_forks_event_max_datetime": "2018-07-26T00:50:10.000Z"}
{"max_stars_count": 1, "max_issues_count": 20, "max_forks_count": 1, "avg_line_length": 18.1086956522, "max_line_length": 76, "alphanum_fraction": 0.4573829532}
import Component from '../component'

export default {
	/**
	 * 初始化
	 */
	init() {
		const options = {
            animateCss: undefined, 
            visible: !1, 
        }

		// 实例化组件
    	const component = new Component({
    		scope: `$wux.backdrop`, 
    		data: options, 
    		methods: {
    			/**
    			 * 保持锁定
    			 */
	    		retain() {
	    			if (typeof this.backdropHolds !== `number` || !this.backdropHolds) {
	    				this.backdropHolds = 0
	    			}

	    			this.backdropHolds++

	    			if (this.backdropHolds === 1) {
	    				this.setVisible()
	    			}
	    		},
	    		/**
	    		 * 释放锁定
	    		 */
	    		release() {
	    			if (this.backdropHolds === 1) {
						this.setHidden()
					}
					this.backdropHolds = Math.max(0, this.backdropHolds - 1)
	    		},
	    	},
    	})

    	return component 	
	},
}