here is my code:
<head>
<meta charset="utf-8">
<!--mobile friendly-->
<meta name="viewport" content="width=device-width, user-scalable=yes">
<script type="text/javascript" src="../../node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<selection>
<selection-item></selection-item>
<selection-item></selection-item>
</selection>
</div>
<script>
Vue.component("selection", {
mounted: function () {
var c = this.$children
console.log(c)
},
template: `<div></div>`
})
new Vue({el: "#app"})
</script>
</body>
the output is Array(0)
, but in my code, selection has children selection-item, so how to get vue component "selection"'s children "selection-item"
here is my vue version:
roroco@roroco ~/Dropbox/js/ro-js/node_modules/vue $ cat package.json |gr version
"_nodeVersion": "8.4.0",
"_npmVersion": "5.4.1",
"version": "2.4.4"