Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

vue中编辑的时候变成input框,取消编辑因为双向绑定值也修改了,如何还是原来的

<td v-if="!editorStatus">{{ register_bussiness }}</td>
<td v-else class="registrar" ><el-input v-model="register_bussiness" /></td>

刚开始 editorStatus = false
点击编辑后editorStatus = true
有一个确定和取消按钮。现在在input里面输入值,点击取消后<td v-if="!editorStatus">{{ register_bussiness }}</td>里面的值也改变。点取消想要还是初始值


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

文本用一个值表示(register_bussiness),input用另一个(register_bussiness1),确定时候register_bussiness=register_bussiness1,取消register_bussiness1=register_bussiness


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...