我制作了一个非常简单的SFC,希望将其托管在npm上并将其安装在其他vue项目中。这取决于一些可视化组件。
目前,我收到错误消息,即使我尝试在所有地方都注册了vuetify(请参阅Vue/Vuetify - Unknown custom element: did you register the component correctly?)。
是否有等效于https://vuetifyjs.com/en/framework/a-la-carte的汇总
// webpack.config.js
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin')
module.exports = {
plugins: [
new VuetifyLoaderPlugin()
]
}
更新
// script tag of SFC
import { VProgressCircular } from 'vuetify/lib'
export default {
name: 'AsyncSlot',
components: {
VProgressCircular
},
...
}
导入这样的组件会导致Rollup抱怨
(!) Circular dependency: node_modules/vuetify/lib/components/VBreadcrumbs/index.js -> node_modules/vuetify/lib/components/VBreadcrumbs/VBreadcrumbs.js -> node_modules/vuetify/lib/components/VBreadcrumbs/index.js
(!) Circular dependency: node_modules/vuetify/lib/components/VTimePicker/VTimePicker.js -> node_modules/vuetify/lib/components/VTimePicker/VTimePickerTitle.js -> node_modules/vuetify/lib/components/VTimePicker/VTimePicker.js
(!) Circular dependency: node_modules/vuetify/lib/components/VTreeview/VTreeviewNode.js -> node_modules/vuetify/lib/components/VTreeview/VTreeviewNode.js