<template>
	<ciy-header title="ciy-inputcyc组件"></ciy-header>
	<view class="ciy-card">
		<view class="title">执行周期输入框</view>
		<view class="content">
			支持月/秒，86400整除为天，60整除为分钟。<br />
			月为负值，秒为正值，0为不设置周期。<br />
		</view>
	</view>
	<form @submit="submitlog">
		<view class="ciy-form">
			<label>v-model绑定</label>
			<view>
				<ciy-inputcyc name="ciy1" v-model="formvalue" @change="chglog('change', $event)"></ciy-inputcyc>
			</view>
		</view>
		<view class="ciy-form">
			<label>左侧</label>
			<view>
				<ciy-inputcyc left hasmore name="ciy2" :value="formvalue" @change="chglog('change', $event)"></ciy-inputcyc>
			</view>
		</view>
		<view class="ciy-form">
			<label>传统</label>
			<view>
				<ciy-inputcyc bb name="ciy3" :value="formvalue" @change="chglog('change', $event)"></ciy-inputcyc>
			</view>
		</view>
		<view class="ciy-form">
			<label>禁用</label>
			<view>
				<ciy-inputcyc disabled name="ciy4" :value="formvalue" @change="chglog('change', $event)"></ciy-inputcyc>
			</view>
		</view>
		<view class="ciy-form">
			<label>选择</label>
			<view>
				<ciy-inputcyc bb name="ciy5" range="month,day,hour,min,sec" :value="formvalue" @change="chglog('change', $event)"></ciy-inputcyc>
			</view>
		</view>
		<view class="txt-center px4 py4">
			<button class="btn" form-type="submit">提交表单</button>
			<button class="btn" @tap="formvalue='-2'">改月</button>
			<button class="btn" @tap="formvalue='86400'">改天</button>
			<button class="btn" @tap="formvalue='180'">改秒</button>
		</view>
		<view class="ciy-card formcard" v-if="formdata">
			<view class="content">
				<view v-html="tobr(formdata, true)" class="formdata"></view>
			</view>
		</view>
	</form>
	<view class="ciy-card">
		<view class="title">属性</view>
		<view class="content">
			<view class="prp">name,value,v-model</view>
			<view class="hr"></view>
			<view class="prp">disabled</view>
			<view class="tip">
				禁止选择。<br />
				默认 false
			</view>
			<view class="hr"></view>
			<view class="prp">initevent</view>
			<view class="tip">
				是否产生初始事件。<br />
				默认 false
			</view>
			<view class="hr"></view>
			<view class="prp">hasmore</view>
			<view class="tip">
				是否form携带更多格式的数据。<br />
				unit,num<br />
				默认 false
			</view>
			<view class="hr"></view>
			<view class="prp">left</view>
			<view class="tip">
				是否左侧显示。<br />
				默认 false
			</view>
			<view class="hr"></view>
			<view class="prp">bb</view>
			<view class="tip">
				是否传统文本框样式。<br />
				默认 false
			</view>
			<view class="hr"></view>
			<view class="prp">range</view>
			<view class="tip">
				可选择单位，支持month,day,hour,min,sec。<br />
				默认 month,day,min
			</view>
		</view>
	</view>
	<view class="ciy-card">
		<view class="title">方法</view>
		<view class="content">
			无
		</view>
	</view>
	<view class="ciy-card">
		<view class="title">事件</view>
		<view class="content">
			<view class="evt">@change, update:modelValue</view>
			<view class="tip">
				数据变更事件<br />
				from: init,num,unit
			</view>
			<view class="hr"></view>
			<view class="log" v-for="(item, index) in eventlog" :key="index">
				<text class="code">{{eventlog.length - index}}</text>
				{{item}}
			</view>
		</view>
	</view>
	<view class="hr"></view>
</template>

<style>
	@import '@/pages/demo/zdemo.css';
</style>

<script>
	import zmixin from '@/pages/demo/zmixin.js';
	export default {
		mixins: [zmixin],
		data() {
			return {
				formvalue: ''
			}
		},
		onLoad() {},
		methods: {}
	}
</script>