1 components文件下的vue文件

<template name="page-head">
	<view class="uni-page-head">
		<view class="uni-page-head-title">{{title}}</view>
	</view>
</template>
<script>
	export default {
		name: "page-head",
		props: {
			title: {
				type: String,
				default: ""
			}
		}
	}
</script>

2 main.js

import pageHead from './components/page-head.vue'

Vue.component('page-head',pageHead)

3 需要引用的文件下

<page-head :title="title"></page-head>

Logo

前往低代码交流专区

更多推荐