uni-app全局组件引用
1 components文件下的vue文件<template name="page-head"><view class="uni-page-head"><view class="uni-page-head-title">{{title}}</
·
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>
更多推荐
已为社区贡献3条内容
所有评论(0)