uview
- uView是uni-app生态专用的UI框架,很像elemeUI在项目里注册完可以直接使用
- 官方网址:https://www.uviewui.com/components/intro.html
props
用的时候需要注意根据文档里的参数和说明使用,这里以Navbar 自定义导航栏
的两个参数和两种方式举例:
原本的样子
<template>
<view class="content">
<u-navbar title="" :bgColor="bgColor"></u-navbar>
</view>
</template>
使用props 传入参数两种方式
- 方式一::title=“title”
- 方式二:leftIconColor=“green”>
<template>
<view class="content">
<u-navbar title="" :bgColor="bgColor" :title="title" leftIconColor="green"></u-navbar>
</view>
</template>
<script>
export default {
data() {
return {
bgColor: 'pink',
title:'标题'
}
}
}
</script>
说明及注意事项:
需要在<u-xx>
的标签内添加属性名="值"
或:属性名="值"
的参数