[Vuejs]-How do I bind data to an element created with this.$createElement

0👍

According to the Template Compilation section in the docs,

<input v-model="inputVal">

is this render function:

function anonymous(
) {
    with(this){
        return _c('input', {
            directives: [{
                name: "model",
                rawName: "v-model",
                value: (inputVal),
                expression: "inputVal"
            }],
            domProps: { "value": (inputVal) },
            on: {
                "input": function($event) {
                    if ($event.target.composing)
                        return;
                    inputVal=$event.target.value
                }
            },
        })
    }
}

I haven’t used render functions yet, so I hope this is what you need.

Leave a comment