Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
259 views
in Technique[技术] by (71.8m points)

Vue.complile生成对象中staticRenderFns数组是用来做什么的呢

最近用到这个Vue.compile命令在控制台打印的时候看到的。
result包含一个render函数,一个staticRenderFns数组。这个数组是做什么的呢

<div id="app">
</div>
<script>
var vm = new Vue({
    el: "#app",
    data: {
        temp: "<div>1234</div>",
        template: function () {
            return null
        }
    },
    render(h){
        return h('div', [this.template()]);
    },
    mounted() {
        const result = Vue.compile(this.temp);
        this.template = result.render;
        console.log(result);
    }
})
</script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...