使用VUE形式输入绑定有条件绑定问题
有人可以帮助我弄清楚我们如何根据输入是否没有输入,一个或多个逗号来输出不同绑定的方式为这种绑定添加条件吗?
<p>{{ target}}</p>
<input v-model="target" placeholder="Enter Your Target" />
因此,如果输入没有逗号,则输出将是
You Entered `London`
一个逗号
You Entered `London` AND `Paris`
,并且如果许多
You Entered `London` AND `Paris` AND `Rome`
Can someone please help me to figure it our how to add a condition to this Binding in a way that output different binding based on if the input has none, one or many Comma in it?
<p>{{ target}}</p>
<input v-model="target" placeholder="Enter Your Target" />
so in case that input has no comma the output will be
You Entered `London`
If One Comma
You Entered `London` AND `Paris`
and if many
You Entered `London` AND `Paris` AND `Rome`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许喜欢以下:
Maybe like following: