Closed lishaobos closed 1 year ago
<component :is='xx' is not work.
user can provide some comments:
/* unplugin-vue-components ['name1', 'name2'] */
or we can provide API like this:
defineUnpluginComponents( ['name1', 'name2'] )
and then we auto imported name1,name2
before
(_openBlock(), _createBlock(_resolveDynamicComponent("name1")))
after
import name1 from 'xx' import name2 from 'xx' const _getUnpluginDynamicComponent = name => { const _unpluginDynamicComponent = { name1, name2 } return _unpluginDynamicComponent[name] || name } // we can replace the _resolveDynamicComponent (_openBlock(), _createBlock(_resolveDynamicComponent(_getUnpluginDynamicComponent("name1")))) // or we can inject components defineCompoennt({ components: { name1, name2 }, setup() { // ... } })
No response
@antfu need some advice.
Thanks, but no. This is considered out of scope. If you need to do that, I'd suggest importing components explicitly or registering them as global components.
ok, i got it
Clear and concise description of the problem
<component :is='xx' is not work.
Suggested solution
user can provide some comments:
or we can provide API like this:
and then we auto imported name1,name2
before
after
Alternative
No response
Additional context
No response
Validations