谷歌浏览器能显示出search组件,但是console报错信息:
[Vue warn]: Unknown custom element: <uni-section> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> at pages/index/index.vue
页面代码如下
<template>
<view class="content">
<uni-section title="自定义样式" subTitle="使用 bgColor 属性自定义背景色" type="line">
<uni-search-bar placeholder="自定义背景色" bgColor="#EEEEEE" @confirm="search" />
</uni-section>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
search(res) {
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
}
}
}
</script>
<style>
page {
background-color: #f5f5f5;
}
</style>
碌云
uni-section从哪里引入?
2022-04-24 18:46
DCloud_UNI_Anne
回复 碌云: 导入uni-search-bar 搜索栏,完整示例项目里面有uni-section组件
2022-04-24 19:29
碌云
回复 DCloud_UNI_Anne: 为什么官网把uni-section组件下架了。如果你们打算去除uni-section组件那我也没必要用啊,怕后面不兼容
2022-04-24 19:32