介绍
这篇文章将为大家详细讲解有关如何在vue中使用渲染渲染函数,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。
<强> 1。什么是渲染函数? 强>
vue通过模板来创建你的HTML。但是,在特殊情况下,这种写死的模式无法满足需求,必须需要js的编程能力。此时,需要用渲染来创建HTML。
比如如下我想要实现如下HTML:
& lt; div id=癱ontainer"比; ,& lt; h2> & lt;才能a https://www.yisu.com/zixun/href=" # " rel=巴獠縩ofollow”rel="外部nofollow”> 你好世界! >
我们会如下使用:
, & lt; ! DOCTYPE html> & lt; html> ,& lt; head> & lt; title>才能演示Vue & lt;才能style> ,, & lt;才能/style> ,& lt;/head> ,& lt; body> & lt;才能div id=癱ontainer"比; ,,& lt; tb-heading :水平=?“比; ,,,& lt; a https://www.yisu.com/zixun/href=" # " rel=巴獠縩ofollow”rel="外部nofollow”> Hello world ! >