Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用元素ui和vue js在更改select后设置输入焦点_Javascript_Vue.js_Element Ui - Fatal编程技术网

Javascript 使用元素ui和vue js在更改select后设置输入焦点

Javascript 使用元素ui和vue js在更改select后设置输入焦点,javascript,vue.js,element-ui,Javascript,Vue.js,Element Ui,我正在选择一种产品,在“选择产品”对话框中,您必须将焦点传递给数量输入,我使用ref,但它对我不起作用 当您需要以Vue外部的方式修改UI时,一个有用的技巧是调用。在您的情况下,这将推迟对focus的调用,直到用户界面在选择后完成更新 ChangueSelectProduct(){ this.$nextTick(()=>this.$refs.cantidad1.focus()) } 当您需要以Vue外部的方式修改UI时,一个有用的技巧是调用。在您的情况下,这将推迟对focus的调用,直到用户界

我正在选择一种产品,在“选择产品”对话框中,您必须将焦点传递给数量输入,我使用ref,但它对我不起作用


当您需要以Vue外部的方式修改UI时,一个有用的技巧是调用。在您的情况下,这将推迟对
focus
的调用,直到用户界面在选择后完成更新

ChangueSelectProduct(){
this.$nextTick(()=>this.$refs.cantidad1.focus())
}

当您需要以Vue外部的方式修改UI时,一个有用的技巧是调用。在您的情况下,这将推迟对
focus
的调用,直到用户界面在选择后完成更新

ChangueSelectProduct(){
this.$nextTick(()=>this.$refs.cantidad1.focus())
}
                <el-select
                      ref="select1"
                      v-model="EntradaProducto.ProductoSucursalId"
                      filterable
                      style="width: 50%"
                      remote
                      @change="ChangueSelectProduct"
                      placeholder="Escriba nombre del producto"
                      :remote-method="remoteMethodSearchProduct"
                      :loading="loadingSearchProduct">
                      <el-option
                        v-for="item in optionsProducts"
                        :key="item.id"
                        :label="item.descripcion"
                        :value="item.id">
                        <span style="float: left">{{ item.marca +' | '+ item.descripcion }}</span>
                        <span style="float: right; color: #8492a6; font-size: 13px">S/ {{ item.precio }}</span>

                      </el-option>


                </el-select>



                           <el-input
                              ref="cantidad1"
                              type="number"
                              style="width: 90px"
                              placeholder="Cant"
                              v-model="EntradaProducto.Cantidad"

                            ></el-input>
  ChangueSelectProduct(){       
     this.$refs.cantidad1.select();
     this.$refs.cantidad1.focus();  
  },