tiny-vue icon indicating copy to clipboard operation
tiny-vue copied to clipboard

🐛 [Bug]: TinyTooltip 插槽无法响应动态切换

Open chilingling opened this issue 6 months ago • 4 comments

Version

latest

Vue Version

latest

Link to minimal reproduction

playground 链接

Step to reproduce

  1. 业务场景:我们需要动态切换Tooltip 的内容插槽和 content 属性场景。
<tiny-tooltip class="item" effect="dark" content="Top Left 提示文字" placement="top-start" :manual="true" :modelValue="true" data-uid="aaaa">
  <div data-uid="bbb">
    <div>
      <tiny-button>上左</tiny-button>   
    </div>
  </div>
  // 这里需要通过属性开关来控制
  <template v-if="showContent" #content>
    <div>
      fdsafsafdasfds
    </div>
  </template>
</tiny-tooltip>
  1. 实际上,动态切换没有生效,一直显示插槽的内容。

What is expected

能够在插槽和 content 属性之间来回切换。

What is actually happening

实际上,动态切换没有生效,一直显示插槽的内容。

What is your project name

TinyEngine

Any additional comments (optional)

No response

chilingling avatar May 19 '25 02:05 chilingling

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: TinyTooltip slot cannot respond to dynamic switching

Issues-translate-bot avatar May 19 '25 02:05 Issues-translate-bot

目前没有发现其他类似的问题被报告或解决。根据您提供的信息,TinyTooltip 的动态切换功能可能需要进一步的检查和调试。

为了帮助您解决这个问题,您可以尝试以下步骤:

  1. 检查绑定的数据:确保 showContent 的值在切换时确实发生了变化。您可以在控制台中输出 showContent 的值以确认。

  2. 更新机制:确保 Vue 的响应式机制能够检测到 showContent 的变化。可以尝试使用 Vue.set 或者确保 showContent 是在 data 函数中初始化的。

  3. 组件更新:检查 TinyTooltip 组件是否正确地响应了插槽内容的变化。可能需要在组件内部添加对插槽内容变化的监听。

如果这些步骤没有解决问题,可能需要对 TinyTooltip 组件进行更深入的调试,或者查看组件的源码以确认是否存在逻辑上的问题。

如果您需要进一步的帮助,或者希望将此问题提交给开发团队,请告诉我,我可以协助您创建一个问题报告。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

petercat-assistant[bot] avatar May 19 '25 02:05 petercat-assistant[bot]

Bot detected the issue body's language is not English, translate it automatically.


No other similar issues have been found to be reported or resolved. Depending on the information you provide, the dynamic switching function of TinyTooltip may require further inspection and debugging.

To help you solve this problem, you can try the following steps:

  1. Check the bound data: Make sure that the value of showContent does change when switching. You can output the value of showContent in the console to confirm.

  2. Update mechanism: Ensure that Vue's responsive mechanism can detect changes in showContent. You can try using Vue.set or make sure showContent is initialized in the data function.

  3. Component Update: Check that the TinyTooltip component responds correctly to changes in slot content. You may need to add a listening to changes in the slot content within the component.

If these steps do not resolve the issue, you may need to debug the TinyTooltip component more in-depth, or look at the component's source code to confirm whether there are logical problems.

If you need further assistance or would like to submit this issue to the development team, please let me know and I can assist you in creating an issue report.

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

Issues-translate-bot avatar May 19 '25 02:05 Issues-translate-bot

It seems like there was a repetition of the previous response. If you have any further questions or need additional assistance regarding the TinyTooltip issue or any other aspect of opentiny/tiny-vue, feel free to ask!

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

petercat-assistant[bot] avatar May 19 '25 02:05 petercat-assistant[bot]