Skip to content

求组件中动态编译模板的方法 #6117

@jaweii

Description

@jaweii

What problem does this feature solve?

比如说,我想做个在线写vue代码的页面,那么就需要根据用户输入的内容来编译成html,这样用户在页面上即能编辑,也能预览

我查了很多资料,还是没有找到方法,只能来这儿提交了。。。

What does the proposed API look like?

大概像这样:

var inputVal=‘<my-component />’(这是用户输入的内容,my-component是已经全局引入了的组件)
var html=this.compile(inputVal) 然后这样就得到了vue编译后的html代码

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