Vue自定义组件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vue自定义组件相关的知识,希望对你有一定的参考价值。

<!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自定义组件的主要内容,如果未能解决你的问题,请参考以下文章

vue 自定义组件之父子组件

Vue自定义组件父与子

Cesium指南-自定义vue组件

vue之自定义组件

flex 自定义组件

vue中自定义组件(插件)