tiny-vue/examples/sites/demos/mobile/app/input/webdoc/input.js

685 lines
18 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export default {
column: '2',
owner: '',
demos: [
{
demoId: 'autofocus',
name: {
'zh-CN': '自动获取焦点',
'en-US': 'button type'
},
desc: {
'zh-CN': '<p>自动获取焦点</p>',
'en-US': '<p>button type</p>'
},
codeFiles: ['autofocus.vue']
},
{
demoId: 'autosize',
name: {
'zh-CN': '自适应内容高度',
'en-US': 'button round'
},
desc: {
'zh-CN': '<p>自适应内容高度</p>',
'en-US': '<p>button round</p>'
},
codeFiles: ['autosize.vue']
},
{
demoId: 'blur-focus',
name: {
'zh-CN': '获取/失去焦点',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>获取/失去焦点</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['blur-focus.vue']
},
{
demoId: 'clearable',
name: {
'zh-CN': '可清空',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>可清空</p>'
},
codeFiles: ['clearable.vue']
},
{
demoId: 'cols-rows',
name: {
'zh-CN': '原生属性',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>宽度和高度</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['cols-rows.vue']
},
{
demoId: 'counter',
name: {
'zh-CN': '计数与输入统计',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>计数与输入统计</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['counter.vue']
},
{
demoId: 'events',
name: {
'zh-CN': '事件',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>事件</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['events.vue']
},
{
demoId: 'form',
name: {
'zh-CN': 'form',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>form</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['form.vue']
},
{
demoId: 'input-event',
name: {
'zh-CN': '事件',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>blur / focus / input 事件</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['input-event.vue']
},
{
demoId: 'max-min-length',
name: {
'zh-CN': '输入长度限制',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>输入长度限制</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['max-min-length.vue']
},
{
demoId: 'method-select',
name: {
'zh-CN': '选中输入框文本',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>选中输入框文本</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['method-select.vue']
},
{
demoId: 'prefix-suffix',
name: {
'zh-CN': '复合型输入框',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>复合型输入框</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['prefix-suffix.vue']
},
{
demoId: 'props-step',
name: {
'zh-CN': '步长',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>通过<code>step</code>设置步长,需要结合 type="number" 一起使用</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['props-step.vue']
},
{
demoId: 'props',
name: {
'zh-CN': '原生属性',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>是否只读</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['props.vue']
},
{
demoId: 'show-password',
name: {
'zh-CN': '密码框',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>密码框</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['show-password.vue']
},
{
demoId: 'slot-content',
name: {
'zh-CN': '插槽',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>通过<code>content</code>自定义头部内容,只对 type="textarea" 有效</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['slot-content.vue']
},
{
demoId: 'slots-append-prepend',
name: {
'zh-CN': '复合型输入框',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>通过<code>append</code>自定义头部内容,通过 <code>prepend</code>自定义尾部内容,</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['slots-append-prepend.vue']
},
{
demoId: 'suffix-icon',
name: {
'zh-CN': '自定义后置图标',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>自定义后置图标</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['suffix-icon.vue']
},
{
demoId: 'type-be-form-select',
name: {
'zh-CN': '类型<code>type</code>为 form 时的下拉用法',
'en-US': 'events'
},
desc: {
'zh-CN': '<p><code>is-select</code>与<code>select-menu</code>搭配让<code>type</code>为form的输入框变为下拉</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['type-be-form-select.vue']
},
{
demoId: 'type-be-form-tips',
name: {
'zh-CN': 'form类型的文字提示',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>类型<code>type<code>为 form 时的输入框下的提示</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['type-be-form-tips.vue']
},
{
demoId: 'type-be-form',
name: {
'zh-CN': 'type为form类型',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>类型<code>type</code>为 form 时的基本用法</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['type-be-form.vue']
},
{
demoId: 'validate-event',
name: {
'zh-CN': '表单校正',
'en-US': 'events'
},
desc: {
'zh-CN': '<p>通过<code>validate-event</code>属性设置输入时是否触发表单的校验,该属性默认为 true。</p>',
'en-US': '<p>bbutton click</p>'
},
codeFiles: ['validate-event.vue']
}
],
apis: [
{
name: 'Input', // 组件名称展示使用
type: 'component', // API 类型
properties: [
{
name: 'autocomplete',
type: 'String',
defaultValue: 'off',
desc: {
'zh-CN': '<p>原生属性自动补全该属性默认为off</p>',
'en-US': 'display different button'
},
demoId: ''
},
{
name: 'autofocus',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>原生属性自动获取焦点该属性默认为false</p>',
'en-US': 'display different button'
},
demoId: 'autofocus'
},
{
name: 'autosize',
type: 'Boolean | Object',
defaultValue: 'false',
desc: {
'zh-CN':
'<p>自适应内容高度,只对 type="textarea"有效,可传入对象,如,{ minRows: 2, maxRows: 6 }该属性默认为false</p>',
'en-US': 'display different button'
},
demoId: 'autosize'
},
{
name: 'clearable',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>选中时的值</p>',
'en-US': 'display different button'
},
demoId: 'clearable'
},
{
name: 'cols',
type: 'Number',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性,设置宽度,在 type ="textarea"时有效</p>',
'en-US': 'display different button'
},
demoId: 'cols-rows'
},
{
name: 'counter',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>是否显示字数统计,只在 type = "text" 或 type = "textarea" 时有效</p>',
'en-US': 'display different button'
},
demoId: 'counter'
},
{
name: 'disabled',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>禁用该属性默认为false性</p>',
'en-US': 'display different button'
},
demoId: 'autosize'
},
{
name: 'form',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性</p>',
'en-US': 'display different button'
},
demoId: ''
},
{
name: 'is-select',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>type为form时设置输入框可下拉选择</p>',
'en-US': 'display different button'
},
demoId: 'type-be-form-select'
},
{
name: 'label',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框关联的label文字</p>',
'en-US': 'display different button'
},
demoId: 'props'
},
{
name: 'maxlength',
type: 'Number',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性,最大输入长度</p>',
'en-US': 'display different button'
},
demoId: 'max-min-length'
},
{
name: 'minlength',
type: 'Number',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性,最小输入长度</p>',
'en-US': 'display different button'
},
demoId: 'max-min-length'
},
{
name: 'mobile-tips',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性,设置最小值</p>',
'en-US': 'display different button'
},
demoId: 'type-be-form-tips'
},
{
name: 'name',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性</p>',
'en-US': 'display different button'
},
demoId: 'props'
},
{
name: 'placeholde',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框占位文本</p>',
'en-US': 'display different button'
},
demoId: 'prefix-suffix'
},
{
name: 'readonly',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>原生属性是否只读该属性默认为false</p>',
'en-US': 'display different button'
},
demoId: 'props'
},
{
name: 'rows',
type: 'Number',
defaultValue: '2',
desc: {
'zh-CN': '<p>输入框行数,只对 type="textarea"有效该属性默认为2</p>',
'en-US': 'display different button'
},
demoId: 'cols-rows'
},
{
name: 'select-menu',
type: 'Array',
defaultValue: '',
desc: {
'zh-CN': '<p>type为form时设置输入框可下拉选择,设置选择项</p>',
'en-US': 'display different button'
},
demoId: 'type-be-form-select'
},
{
name: 'show-password',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>是否显示切换密码图标该属性默认为false</p>',
'en-US': 'display different button'
},
demoId: 'show-password'
},
{
name: 'show-word-limit',
type: 'Boolean',
defaultValue: 'false',
desc: {
'zh-CN': '<p>是否显示输入字数统计,只在 type = text 或 type = textarea 时有效该属性默认为false</p>',
'en-US': 'display different button'
},
demoId: 'counter'
},
{
name: 'step',
type: 'Number',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性,设置输入字段的合法数字间隔</p>',
'en-US': 'display different button'
},
demoId: 'props-step'
},
{
name: 'suffix-icon',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框尾部图标</p>',
'en-US': 'display different button'
},
demoId: 'suffix-icon'
},
{
name: 'textarea-title',
type: 'String',
defaultValue: '标题',
desc: {
'zh-CN': '<p>textarea类型自定义标题该属性默认为标题</p>',
'en-US': 'display different button'
},
demoId: 'autosize'
},
{
name: ' type',
type: 'String',
defaultValue: 'text',
desc: {
'zh-CN': '<p>input 元素的类型,该属性默认为"text"</p>',
'en-US': 'display different button'
},
demoId: 'autofocus'
},
{
name: 'validate-event',
type: 'Boolean',
defaultValue: 'true',
desc: {
'zh-CN': '<p>输入时是否触发表单的校验该属性默认为true</p>',
'en-US': 'display different button'
},
demoId: 'validate-event'
},
{
name: 'value / v-model',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '<p>绑定值</p>',
'en-US': 'display different button'
},
demoId: 'autofocus'
},
{
name: 'vertical',
type: 'Number',
defaultValue: '',
desc: {
'zh-CN': '<p>原生属性,设置最小值</p>',
'en-US': 'display different button'
},
demoId: 'autofocus'
}
],
methods: [
{
name: 'blur',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>使 input 失去焦点</p>',
'en-US': 'display different button'
},
demoId: 'blur-focus'
},
{
name: 'focus',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>使 input 获取焦点</p>',
'en-US': 'display different button'
},
demoId: 'blur-focus'
},
{
name: 'select',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>选中 input 中的文字</p>',
'en-US': 'display different button'
},
demoId: 'method-select'
}
],
events: [
{
name: 'change',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>在 Input 值改变时触发</p>',
'en-US': 'Click'
},
demoId: 'events'
},
{
name: 'blur',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>在 在 Input 失去焦点时触发</p>',
'en-US': 'Click'
},
demoId: 'blur-focus'
},
{
name: 'focus',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>在 Input 获得焦点时触发</p>',
'en-US': 'Click'
},
demoId: 'blur-focus'
},
{
name: 'clear',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>在点击由 clearable 属性生成的清空按钮时触发</p>',
'en-US': 'Click'
},
demoId: 'blur-focus'
},
{
name: 'input',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>输入值时触发事件</p>',
'en-US': 'Click'
},
demoId: 'input-event'
}
],
slots: [
{
name: 'append',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框后置内容,只对 type="text"有效</p>',
'en-US': 'slots-append-prepend'
},
demoId: ''
},
{
name: 'prepend',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框前置内容,只对 type="text"有效</p>',
'en-US': 'slots-append-prepend'
},
demoId: ''
},
{
name: 'prefix',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框头部内容,只对 type="text"有效</p>',
'en-US': 'Click'
},
demoId: 'prefix-suffix'
},
{
name: 'suffix',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框尾部内容,只对 type="text"有效</p>',
'en-US': 'Click'
},
demoId: 'prefix-suffix'
},
{
name: 'content',
type: '',
defaultValue: '',
desc: {
'zh-CN': '<p>输入框头部内容插槽,只对 type="textarea"有效</p>',
'en-US': 'Click'
},
demoId: 'slot-content'
}
]
}
]
}