递归
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>递归组件</title> </head> <body> <div id="box"> <template> <div> <ggg :msg='msg'></ggg> </div> </template> </div> </body> <script type="text/javascript"> function aa(nub) { var a = nub-3; if(a>0){ aa(a); } alert(a); } aa(7); //结果 -2 1 4 自己调自己 代码运行方式线性 </script> </html>