ntohq / buefy-next

Lightweight UI components for Vue.js (Vue3) based on Bulma
https://v3.buefy.org
MIT License
110 stars 10 forks source link

BSlotComponent does not handle update events from underlying component #45

Closed kikuomax closed 1 year ago

kikuomax commented 1 year ago

Overview of the problem

Buefy version: buefy-next (67ecf3a8b9e1365cc51f37f20b64f85403b0ad8b) Vuejs version: 3.3.4 OS/Browser: macOS/@vue/test-utils

Description

<b-slot-component> does not handle update events from the underlying component.

Steps to reproduce

I encountered this while working on unit tests of SlotComponent:

This bug should affect TabItems with a custom header slot.

Expected behavior

Update events from the underlying component are processed.

Actual behavior

Update events from the underlying component are not processed.

kikuomax commented 1 year ago

The problem is twofold:

  1. Vue lifecycle events were renamed: hook:updatedvue:updated
  2. Vue 3 no longer provides $on and $off APIs
wesdevpro commented 1 year ago

@kikuomax Problem number 1 does not seem like a huge issue image

However, problem number 2 seems to be more of a concern

kikuomax commented 1 year ago

@wesdevpro I ended up with some dark arts:

  1. Exploit the undocumented second argument of onUpdated API.
  2. Directly manipulate VNode's props.