![](https://img-blog.csdnimg.cn/20210806145636448.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
组件库
记录组件库使用时常见问题
Robert_c
这个作者很懒,什么都没留下…
展开
-
Ant Design Vue 下拉框随页面滚动而分离的问题
遇到了个下拉框随页面滚动而分离的问题,后面查找资料,只需要在a-select里面配置以下内容即可:getPopupContainer="triggerNode => triggerNode.parentNode"原创 2021-09-30 10:57:35 · 877 阅读 · 0 评论 -
Ant Design Vue-upload 获取音频/视频时长
结合a-upload使用时,只需要在上传前调用以下代码即可 let url = URL.createObjectURL(this.file); let audioElement = new Audio(url); let duration = parseInt(audioElement.duration); audioElement.addEventListener("loadedmetadata", () =&原创 2021-09-29 15:44:43 · 1071 阅读 · 0 评论 -
Antd Vue-Warning: You cannot set a form field before rendering a field associated with the value
今儿遇到这种错,记录一下出错主要原因有两种:调用setFieldsValue()传入表单的值与表单不对应/调用setFieldsValue()需要在需要放在$nextTick()函数中执行先看第一种,有多少传多少this.form.setFieldsValue({ demo: '1' })第二种,放在$nextTick()中执行this.$nextTick(()=>{ this.form.setFieldsValue({demo:'1'})})...原创 2021-08-24 19:43:57 · 179 阅读 · 0 评论 -
Ant Design Vue-tree:默认展开到第几层
遇到个需求,每次打开页面时tree组件需要默认展开到第几层,记录一下。先看看基础用法,展示可勾选,可选中,禁用,默认展开等功能。更多用法可以去看树形控件 Tree - Ant Design Vue (antdv.com)<template> <a-tree checkable :tree-data="treeData" :default-expanded-keys="['0-0-0', '0-0-1']" :default-selecte.原创 2021-08-10 14:16:05 · 2975 阅读 · 0 评论 -
Ant Design Vue-cascader:修改默认值
今天遇到个需求,需要在选择一个内容后填充其他信息到级联选择器中。记录一下。首先看一下级联选择器的基本用法:<template> <a-cascader :options="options" placeholder="Please select" @change="onChange" /></template><script>export default { data() { return { options: [原创 2021-08-09 20:02:26 · 2645 阅读 · 0 评论 -
Ant Design Vue-Table报错:warning.js?2149:7
今儿使用蚂蚁组件库的table时,遇到个问题:warning.js?2149:7 Warning: [antdv: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.] 。记录一下这是因为columns中定义的默认key值在返回的数据中没有当前的这个字段造成的,一个是使用rowKey默认指定一个对应的键值对,或者使用类似v-for循环中的下标index来代替原创 2021-08-06 14:27:00 · 3081 阅读 · 0 评论