Subscribe on changes!

The Transition does not take effect when using conditional judgment on the diff element in the render function.

avatar
Nov 14th 2023

In the above example, I used the h function without adding a key, which caused a problem. I understand that a key needs to be added during the compilation process. So it is reasonable to add a key manually here.

However, if written in tsx , tsx should go through compilation and still not work.

           <Transition
              name="rotate"
            
            >
              {!isDark.value ? (
                <i
                  
                  class={'inline-block h-5 w-5 i-mingcute-sun-line'}
                />
              ) : (
                <i
                 
                  class={'inline-block h-5 w-5 i-mingcute-moon-line'}
                />
              )}
            </Transition>
avatar
Nov 14th 2023

This issue may be converted to @vue/babel-plugin-jsx