1. 程式人生 > >Vue自定義組件

Vue自定義組件

tex data html head ani pre asc temp animate

<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>組件定義</title> <link rel="stylesheet" type="text/css" href="css/animate.css"> </head> <script type="text/javascript" src="js/vue.js" ></script> <body> <div id="div1"> <my-hello></my-hello> </div> </body> <script> Vue.component(‘my-hello‘,{ template: ‘<h1>hello world!</h1>‘ }); let vm = new Vue({ el: "#div1", data:{ flag:false }, }); </script> </html>

Vue自定義組件