Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

can provide dynamic component with template tag, 能否支持 动态组件 的is属性是空/template #3092

Copy link
Copy link
Closed
@pangao66

Description

@pangao66
Issue body actions

What problem does this feature solve?

now the dynamic component the attribute of "is" must be a html tag or a componet tag,
sometimes , I want the dynamic component the attribute of "is" is empty
such as

<component :is="showTip? 'el-tootip':''template"  >
<el-button>button</el-button>
</compnent>

the example I want if the showTip is true, the button will be wrapped by a tooltip component
else if the showTip is false, there is nothing wrapped the button
so I want vue can provide the component :is with empty
现状是 动态组件 component :is的 is属性只能是 html标签或者已经注册的组件标签
但有时 需求想 is是个空值,
比如有这样的需求

<component :is="showTip? 'el-tootip':''template"  >
<el-button>button</el-button>
</compnent>

给一个button添加tooltip功能, 提供一个 showTip的字段, 如果为true则 则button组件会被一个tooltip组件包裹, 如果此字段为false则不会被任何元素包裹,
所以希望vue能够提供 动态组件 is属性是空值

What does the proposed API look like?

<component :is="showTip? 'el-tootip':''template"  >
<el-button>button</el-button>
</compnent>
<component :is="showTip? 'el-tootip':''"  >
<el-button>button</el-button>
</compnent>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.