<template>
<input
ref="input"
v-model="value">
</template>
<script>
import Vue from 'vue';
export default Vue.extend({
data() {
return {
value: '',
};
},
created() {
this.value = this.params.value;
},
mounted() {
Vue.nextTick(() => {
// need to check if the input reference is still valid - if the edit was cancelled before it started there
// wont be an editor component anymore
if (this.$refs.input) {
this.$refs.input.focus();
}
});
},
methods: {
getValue() {
return this.value;
},
},
});
</script>
Is there any particular reason that we shoudn't do it?
For eg:
Is there any particular reason that we shoudn't do it?
Thanks