},
setup() {
// resolve in setup
- const FooBar = resolveComponent('foo-bar') as any
+ const FooBar = resolveComponent('foo-bar')
return () => {
// resolve in render
- const BarBaz = resolveComponent('bar-baz') as any
+ const BarBaz = resolveComponent('bar-baz')
return h('div', [h(FooBar), h(BarBaz)])
}
},
},
setup() {
// resolve in setup
- const FooBar = resolveDirective('foo-bar')!
+ const FooBar = resolveDirective('foo-bar')
return () => {
// resolve in render
- const BarBaz = resolveDirective('bar-baz')!
+ const BarBaz = resolveDirective('bar-baz')
return withDirectives(h('div'), [[FooBar], [BarBaz]])
}
},
const handler = vi.fn((err, instance, info) => {
expect(err).toBe(error)
- expect((instance as any).count).toBe(count.value)
+ expect(instance.count).toBe(count.value)
expect(info).toBe(`render function`)
})
}
const app = createApp(Root)
- Object.defineProperty(app.config, 'isNativeTag', {
- value: isNativeTag,
- writable: false,
- })
-
app.mount(nodeOps.createElement('div'))
expect(
`Do not use built-in directive ids as custom directive id: bind`,