unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue

Home Page:https://www.npmjs.com/package/unplugin-vue-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

在Element-plus中使用 <component :is="componentId" ></component> 按需引入不会自动添加 style

lyh0371 opened this issue · comments

<template>
  <div>
    <el-button>你好</el-button>

    <component :is="componentId" v-model="val"></component>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { ElSelect } from 'element-plus';

const val = ref(true);
const componentId = ref(ElSelect);
</script>

image

componentId 是不可预测的。在运行时,它可以为任何组件。所以我认为超出了本插件的范围。
The componentId is unpredictable. At runtime, it can be for any component. So I think it is beyond the scope of this plugin.