/
githubmirror
/
element
Обзор
Документация
Войти
/
githubmirror
/
element
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
examples/components/theme-configurator/editor/input.vue
45 строк
747 B
iamkun
chore: init theme (#14508)
28 фев 2019, 11:00
28 фев 2019, 11:00
febdd3b
Код
Авторство
О чём код?
<template> <el-input @keyup.enter.native="onUpdate" v-model="value" @blur="onUpdate" v-bind="$attrs" > <template slot="suffix"> <slot name="suffix"></slot> </template> </el-input> </template> <script> export default { props: ['val', 'onChange'], data() { return { value: '', oldValue: '' }; }, methods: { onUpdate(e) { const { value } = e.target; if (value !== this.oldValue) { this.oldValue = value; this.$emit('change', value); } } }, watch: { val: { immediate: true, handler(value) { this.value = value; if (!this.oldValue) { this.oldValue = value; } } } } }; </script>