0

大家好,我正在尝试在 vuejs 模板中使用引导表单助手(货币选择器),但无法在选择器 div 中检索和定义实例。这个模板代码。

    <form @submit.prevent="createCurrency()">
      <div class="form-body">

        <div class="row">
          <div class="col-md-12">
            <div class="form-group">
              <label for="projectinput1">Select Currency</label>
              <div class="bfh-selectbox bfh-currencies" data-currency="EUR" data-flags="true" v-model="form.currency">
              </div> 
            </div>
          </div>
        </div> 
      </div> 
    </form> 
</template> 

这是Vue代码。

export default {
  data() {
    return { 
      sick_type: {}, 
      name:null,
      form:{ 
        currency: null,  
      }
    };
  },

  methods: { 
    createCurrency() {
      this.$Progress.start();
      axios
        .post("/api/currency/store", this.form)
        .then(() => {
         Swal.fire({
          position: 'top-end',
          icon: 'success',
          type:'success',
          title: 'Your work has been saved',
          showConfirmButton: false,
          timer: 1500
        });

          this.$Progress.finish();
          this.$router.push({ path: "/currency" });
        })
        .catch(() => {
          this.$Progress.fail();
          console.log("Failed to create",this.form);
        });
    }, 
  },
   created: function() {
      //  this.currencyList();


   },
};

v-model="form.currency" 不起作用,请告诉我 wath 是解决方案吗?

4

0 回答 0