[Vue基础实战]render函数使用-1
参考代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>render函数演示1</title> </head> <body> <div id="app"> 看不见我 </div> <script src="../js/vue.js"></script> <script> var login=Vue.extend({ template:'<h3>登录</h3>' }); const app = new Vue({ el: '#app', data: { }, methods: { }, render:function(createElements){ return createElements(login); } }); </script> </body> </html>