<template>
	<van-action-sheet
	v-model="show"
	:actions="actions"
	:cancel-text="canceltext"
	:title="title"
	@cancel="onCancel" />
</template>

<script>
	export default {
		name: "lj_actionSheet",
		data() {
			return {
				show: false,
				actions: [],
			};
		},
		props:{
			canceltext:{
				type:String,
				default:"取消"
			},
			title:{
				type:String,
				default:""
			},
			iscloseonclick:{
				type:Boolean,
				default: true
			}
		},
		methods:{
			open(){
				this.show = true;
			},
			setValue(value){
				var toString = Object.prototype.toString;
				//判断传入value数据类型
					//是否为数组
						//否,提示错误
				if(toString.call(value) !== "[object Array]"){
					alert("actionSheet数据传输错误");
					return;
				}
						//是
				this.actions = value;
			},
			onCancel(){
				this.show = false;
			}
		}
	};
</script>