Home  >  Article  >  Backend Development  >  javascript - js解析自定义公式并进行计算的问题

javascript - js解析自定义公式并进行计算的问题

WBOY
WBOYOriginal
2016-06-06 20:18:033481browse

javascript - js解析自定义公式并进行计算的问题

需要实现的效果是当两个input在输入值得时候解析后端传过来的公式并将计算结果同步输入到指定的文本框中,这该怎么实现呢?

回复内容:

javascript - js解析自定义公式并进行计算的问题

需要实现的效果是当两个input在输入值得时候解析后端传过来的公式并将计算结果同步输入到指定的文本框中,这该怎么实现呢?

你应该用 MVVM 框架

试试 http://vuejs.org/

发现其实可以不用那么麻烦,直接替换就好了:

https://jsfiddle.net/hsfzxjy/Lk1mu0cw/1/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn