Record how to customize the mount point of the drawer, select, and modal components of the ant design vue library

1. The method for drawer to customize the mount point is

insert image description here
Instructions:

<div ref='container'>
	<a-drawer
	      class="model-service-add-omai-dialog"
	      :title="title"
	      :closable="true"
	      placement="right"
	      :visible="dialogVisible"
	      @close="handleClose"
	      :get-container="() => {return this.$refs.container}"
	    >
	</a-drawer>
</div>

// 或者
<div ref='container'>
	<a-drawer
	      class="model-service-add-omai-dialog"
	      :title="title"
	      :closable="true"
	      placement="right"
	      :visible="dialogVisible"
	      @close="handleClose"
	      :get-container="getContainer"
	    >
	</a-drawer>
</div>
methods: {
    
    
	getContainer() {
    
    
		return this.$refs["container"];
	}
}

2. The mounting method provided by the select official website is

insert image description hereinsert image description here
But I found that using it like this will report an error, and eslint will report an error. Baidu has found a solution for a long time, as follows

<a-select
     v-if="inputVisible"
     :open="openSelect"
     ref="input"
     v-model="tagIds"
     style="width: 130px;"
     mode="multiple"
     @blur="handleInputConfirm"
     @keyup.enter="handleInputConfirm"
     :getPopupContainer="triggerNode => {
     return triggerNode.parentNode || document.body;
     }"
   >
     <a-select-option v-for="itm of dwOptions" :key="itm.id + ''">
       {
   
   { itm.name }}
     </a-select-option>
   </a-select>

Guess you like

Origin blog.csdn.net/qq_36877078/article/details/127538124