如何将动态道具传递给 vue 的渲染功能?

问题描述

我尝试根据描述动态渲染组件。
来自

 @PostMapping
    fun uploadCsvFile(
        @RequestPart("file") filePart: FilePart
    ){
        

        filePart.content()
            .map { ??? }


    }

我会渲染

{component: 'customComponent',props: {value: "val1"},...}

我的目标是为任意事件和动态道具做到这一点。
我不知道如何传递动态道具来渲染。

部分解决方案:

基于 (https://symfonycasts.com/screencast/vue/vue-instance) 的一种解决方案可以在每次 <custom-component :value="val1" @input="v=>val1=v" />` 更改时重新呈现

val1

我尝试使用 VueJS 文档

我在 docs on render 中找不到如何传递动态变量。

在最小的实现中你可以看到我已经完成了多远,如果你能帮我完成它,那就太棒了!

到目前为止的最小实现

我希望看到“hello”而不是“values.value1”,一旦我更改了文本框中的文本,values.value1 应该会更新。

演示.html:

render: function(h){
    const template = "...building up the html here..."
    return Vue.compile(template).render.call(this,h);
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)