1. 在页面中注册
<template>
<view>
</view>
</template>
<script>
import pageHead from "@/components/page-head/page-head.vue";
export default {
//注册为子组件
components: {
pageHead
},
data() {
return {
}
},
methods: {
},
onLoad:function(){
}
}
</script>
<style>
</style>
2. 在 main.js 中注册为全局组件
import pageHead from './components/page-head.vue'
Vue.component('page-head', pageHead)
网友评论