<template>
<div>
<input v-model="first"></input>
<input v-model="second"></input>
<input v-model="action"></input>
</div>
</template>
<script>
// import { set } from 'js-cookie'
export default {
data() {
return {
'first': 'tom',
'second': 'eat'
// 'action': ''
}
},
computed: {
action: {
get() {
return this.first + '-' + this.second
},
set(val) {
this.first = val.split('-')[0]
this.second = val.split('-')[1]
}
}
}
}
</script>