提交 d4856f24 编写于 作者: D dolymood

feat(input): add blur & focus api

上级 7a8dd25f
export default {
methods: {
focus() {
this.$refs.input.focus()
},
blur() {
this.$refs.input.blur()
}
}
}
......@@ -30,6 +30,7 @@
</template>
<script type="text/ecmascript-6">
import inputMixin from '../../common/mixins/input'
const COMPONENT_NAME = 'cube-input'
const EVENT_INPUT = 'input'
const EVENT_CHANGE = 'change'
......@@ -38,6 +39,7 @@
export default {
name: COMPONENT_NAME,
mixins: [inputMixin],
props: {
value: [String, Number],
type: {
......
<template>
<div class="cube-textarea-wrapper" :class="{'cube-textarea_expanded': expanded, 'cube-textarea_active': isFocus}">
<textarea
ref="input"
class="cube-textarea"
v-model="textareaValue"
v-bind="$props"
......@@ -15,6 +16,7 @@
</template>
<script type="text/ecmascript-6">
import inputMixin from '../../common/mixins/input'
const COMPONENT_NAME = 'cube-textarea'
const EVENT_INPUT = 'input'
......@@ -25,6 +27,7 @@
export default {
name: COMPONENT_NAME,
mixins: [inputMixin],
data() {
return {
textareaValue: this.value,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册