Переглянути джерело

回车键快捷定位表单下一项

chenrui 3 роки тому
батько
коміт
f0de61dc0f
1 змінених файлів з 7 додано та 0 видалено
  1. 7 0
      src/views/productManagement/productInfo/edit.vue

+ 7 - 0
src/views/productManagement/productInfo/edit.vue

@@ -340,6 +340,13 @@ export default {
     pageInit () {
       this.getProductType()
       this.$refs.ruleForm.resetFields()
+      // 默认首项获取焦点
+      const _this = this
+      setTimeout(() => {
+        if (_this.$refs['name']) {
+          _this.$refs['name'].focus()
+        }
+      }, 300)
       if (this.$route.params.id) { //  编辑页
         this.getGoodsDetail()
       }