表格中平时显示是span 点击之后变为input
{{item.wenzi}}
methods: {
blur: function () {
this.editing = false
},
edit: function () {
this.editing = true
this.$nextTick(function () {
this.$els.input.focus()
})
},
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
模擬測試你的代碼,正常耶...
有什麼詳細的報錯嗎?
不過你有個地方寫錯了
v-on:keyup.enter="blur()"應該改成@blur="blur"才會在失焦時變成span模擬