5***@qq.com
5***@qq.com
  • 发布:2023-07-11 17:06
  • 更新:2023-07-11 18:24
  • 阅读:188

vue2正常 vue3异常 uni-ui扩展组件中 uni-list组件

分类:uni-app

相同的代码 如下

<template>  
    <view class="container">  
        <uni-list>  
            <uni-list-item direction="row"> <!-- 自定义内容列表 direction默认row且内部遵循flex布局 -->  
                <view slot="header">1</view>  
                <view slot="body">2</view>  
                <view slot="footer">3</view>  
            </uni-list-item>  
        </uni-list>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {}  
        },  
        methods: {  

        }  
    }  
</script>  

<style>  
    .container {  
        padding: 20px;  
        font-size: 14px;  
        line-height: 24px;  
    }  
</style>

我是如何发现问题的
1、我创建了一个新的项目 选择了uni-ui版本选择vue3

2、写了上诉代码 发现没有渲染
3、于是如下图所示 在当前项目中切换至vue2 然后重启就正常了

vue2版本渲染效果

vue3版本渲染效果

2023-07-11 17:06 负责人:无 分享
已邀请:
爱豆豆

爱豆豆 - 办法总比困难多

测试后没发现不渲染的问题 你是怎么使用的 可以把你的代码片段贴出来吗?

  • 5***@qq.com (作者)

    好的 我更新了描述问题的内容

    2023-07-11 17:27

  • 爱豆豆

    回复 5***@qq.com:

    v2和v3的插槽使用方式不一样

    <uni-list>

    <uni-list-item direction="row"> <!-- 自定义内容列表 direction默认row且内部遵循flex布局 -->

    <template #header>

    <view class="slot-box">1</view>

    </template>

    <template #body>

    <view class="slot-box">2</view>

    </template>

    <template #footer>

    <view class="slot-box">3</view>

    </template>

    </uni-list-item>

    </uni-list>

    2023-07-11 18:07

  • 5***@qq.com (作者)

    回复 爱豆豆: 哦 可以了 谢谢大佬 ♪(・ω・)ノ

    2023-07-11 18:26

  • 爱豆豆

    回复 5***@qq.com: 麻烦点个赞 哈哈

    2023-07-11 18:27

  • 5***@qq.com (作者)

    回复 爱豆豆: 点了 ♪(・ω・)ノ

    2023-07-11 18:31

piaoyi_UI

piaoyi_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

能具体描述问题吗,提供效果截图和代码截图可以高效率解决问题

  • 5***@qq.com (作者)

    好的 我更新了描述问题的内容

    2023-07-11 17:27

要回复问题请先登录注册