uni-app 属性丢失,使用小红书post-note-button组件,传递属性丢失导致组件不可用

uni-app 属性丢失,使用小红书post-note-button组件,传递属性丢失导致组件不可用

note-list.vue 代码

<post-note-button  
    style="width: 100%;"  
    :title="noteTitle"  
    :content="noteContent"  
    :media-info="mediaInfo"  
    :tags="tags"  
    ></post-note-button>

编译后代码: <post-note-button xhs:if="{{m}}" style="width:100%" u-i="318bbfc2-0" bind:l="{{l}}" u-p="{{m}}"></post-note-button>

期望编译后代码: <post-note-button xhs:if="{{m}}" style="width:100%" title="{{i}}" content="{{j}}" media-info="{{k}}" tags="{{l}}" u-i="318bbfc2-0" bind:l="{{l}}" u-p="{{m}}"></post-note-button>

目前暂时用 直接修改编译后代码来解决这个问题了。期望官方可以解决 或者在哪里配置可以解决。


更多关于uni-app 属性丢失,使用小红书post-note-button组件,传递属性丢失导致组件不可用的实战教程也可以访问 https://www.itying.com/category-93-b0.html

4 回复

hello , 这里提供一下临时的解决方案:将下方的 dist 压缩包,替换到下方路径下的 dist 文件夹
/HBuilderX-Alpha.app/Contents/HBuilderX/plugins/uniapp-cli-vite/node_modules/@dcloudio/uni-mp-xhs
windows路径类似

更多关于uni-app 属性丢失,使用小红书post-note-button组件,传递属性丢失导致组件不可用的实战教程也可以访问 https://www.itying.com/category-93-b0.html


替换后也不行啊

回复 5***@qq.com: 是 vue3 吗?

这是一个uni-app编译过程中属性传递丢失的典型问题。针对小红书post-note-button组件的属性丢失情况,建议检查以下几个方面:

  1. 确保组件在pages.json中正确注册,并且使用了正确的componentPlaceholder配置:
"usingComponents": {
  "post-note-button": "/components/post-note-button/index"
}
  1. 检查组件是否使用了正确的props声明方式。在小程序环境中,需要显式声明组件接受的属性:
// post-note-button组件内部
properties: {
  title: String,
  content: String,
  'media-info': Object,
  tags: Array
}
回到顶部