首页 > 解决方案 > 不使用jQuery,根据其他输入更改输入标签的值

问题描述

我有 2 个输入标签

Title:
    <b-input
      style="width: 50%"
      v-model="value.title"
      class="input-element"
      placeholder="Title"
      v-on:click="greet"
    />
Id:
    <b-input
      id="id"
      style="width: 50%"
      class="input-element"
      placeholder="Id"
      v-model="value.id"
    />

每当我写东西时,我希望输入的值与小写标题的值相同。

标签: htmlvue.jsvuejs2bootstrap-vue

解决方案


您可以使用将标题更改为小写的计算字段,然后使 id 输入的 v-model 使用该计算字段


推荐阅读