You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should share the settings of babel-plugin-import, only add elementPrefix . When the vue template compiler see a unknown custom element which has this prefix, insert a import statement, and add to vue.components .
The text was updated successfully, but these errors were encountered:
viruscamp
changed the title
Auto generate import component statement from element tag in vue template . 根据 vue template 内的元素tag自动生成 import 组件语句
[Feature Request]Auto generate import component statement from element tag in vue template . 根据 vue template 内的元素tag自动生成 import 组件语句
Jan 29, 2019
What problem does this feature solve?
If we use 'Fully Import', we can write a component like this:
当完整引入组件时, 我们像这样写新组件
If we use 'Import on Demand', with the help of babel-plugin-import, a component looks like this:
当按需引入组件时, 在 babel-plugin-import 的帮助下, 我们像这样写新组件
Why can't the build system auto generate import component statement from element tag in vue template?
为什么构建系统不能根据 vue template 里面的元素 tag 自动生成 import 组件语句呢?
This feature is used in 'Import on Demand' , but we can write component like 'Fully Import'.
此功能用于按需引入组件时, 也能用像完整引入时一样的写法写新组件.
It must inject into vue template compile stage, collect all 'Unknown custom element' errors, and translate the file to:
需要能深入 vue 模板编译阶段, 收集所有的'Unknown custom element'未知自定义元素错误, 然后翻译成:
What does the proposed API look like?
It should share the settings of babel-plugin-import, only add elementPrefix . When the vue template compiler see a unknown custom element which has this prefix, insert a import statement, and add to vue.components .
应该共享 babel-plugin-import 的设置, 只是加一个 elementPrefix 元素前缀. 当 vue 模板编译器遇到有此前缀的未知元素时, 插入 import 组件语句, 并将组件加入 vue.components.
The text was updated successfully, but these errors were encountered: