ant-design-vue 1.X 通过id获取a-input组件失败

1.ant-design-vue 1.X

问题描述

当我在a-form组件中,以v-decorator指令绑定表单组件时,无法根据我设置的verify-code-input获取元素

html 复制代码
<a-input type="text" 
	id="verify-code-input" 
	class="paIpt"
	:placeholder="$t('register.register_verification_code1')"
    v-decorator="['verifyCode', validatorRules.verifyCode]" />
js 复制代码
document.getElementById('verify-code-input'); // null

原因分析

我查看了网页源码,发现input元素已经有了id="verifyCode",因此我们设置的verify-code-input无法生效

html 复制代码
<input data-v-58ee6438="" placeholder="Verification Code" type="text" id="verifyCode" data-__meta="[object Object]" data-__field="[object Object]" class="paIpt ant-input">
相关推荐
LYFlied13 小时前
【每日算法】LeetCode 1143. 最长公共子序列
前端·算法·leetcode·职场和发展·动态规划
老华带你飞13 小时前
农产品销售管理|基于java + vue农产品销售管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端
小徐_233314 小时前
2025 前端开源三年,npm 发包卡我半天
前端·npm·github
C_心欲无痕14 小时前
vue3 - 类与样式的绑定
javascript·vue.js·vue3
GIS之路14 小时前
GIS 数据转换:使用 GDAL 将 Shp 转换为 GeoJSON 数据
前端
JIngJaneIL14 小时前
基于springboot + vue房屋租赁管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端
天天扭码14 小时前
以浏览器多进程的角度解构页面渲染的整个流程
前端·面试·浏览器
你们瞎搞15 小时前
Cesium加载20GB航测影像.tif
前端·cesium·gdal·地图切片
南山安15 小时前
Tailwind CSS:顺风CSS
javascript·css·react.js
milanleon15 小时前
使用Spring Security进行登录认证
java·前端·spring