<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>注册局部组件</title> <script type="text/javascript" src="vue.js"></script> </head> <body> <div id="app"> <aa-aa></aa-aa> </div> <script type="text/javascript">
//局部组件注册 var ComponentA = { template : '<div>this a component</div>', } var vm = new Vue({ el: '#app', components: { 'aa-aa':ComponentA }, }); </script> </body> </html>
标签:aa,ComponentA,局部,var,注册,组件 From: https://www.cnblogs.com/aigu/p/16888878.html