|
|
@@ -3,6 +3,7 @@
|
|
|
*/
|
|
|
|
|
|
import {
|
|
|
+ type ObjectDirective,
|
|
|
Suspense,
|
|
|
Teleport,
|
|
|
Transition,
|
|
|
@@ -1695,5 +1696,24 @@ describe('SSR hydration', () => {
|
|
|
app.mount(container)
|
|
|
expect(`Hydration style mismatch`).not.toHaveBeenWarned()
|
|
|
})
|
|
|
+
|
|
|
+ // #11189
|
|
|
+ test('should not warn for directives that mutate DOM in created', () => {
|
|
|
+ const container = document.createElement('div')
|
|
|
+ container.innerHTML = `<div class="test red"></div>`
|
|
|
+ const vColor: ObjectDirective = {
|
|
|
+ created(el, binding) {
|
|
|
+ el.classList.add(binding.value)
|
|
|
+ },
|
|
|
+ }
|
|
|
+ const app = createSSRApp({
|
|
|
+ setup() {
|
|
|
+ return () =>
|
|
|
+ withDirectives(h('div', { class: 'test' }), [[vColor, 'red']])
|
|
|
+ },
|
|
|
+ })
|
|
|
+ app.mount(container)
|
|
|
+ expect(`Hydration style mismatch`).not.toHaveBeenWarned()
|
|
|
+ })
|
|
|
})
|
|
|
})
|