我开始基于vue.js创建一个项目: https://github.com/creativetimofficial/vuetify-material-dashboard
尝试集成TableList.vue
组件时,出现错误:
Unknown custom element: <material-card> - did you register the component correctly?
Vue.js项目是使用Webstorm创建的。我复制了styles
文件夹,并使观察者能够将scss文件编译为css。我在WebStorm中使用npm serve
命令运行项目。
我的App.vue看起来有点不同:
<template>
<v-app>
<TheBar />
<TheNavigationDrawer />
<TheView />
</v-app>
</template>
<script>
import TheBar from '@/components/core/TheBar.vue'
import TheNavigationDrawer from "@/components/core/TheNavigationDrawer";
import TheView from '@/components/core/TheView.vue'
export default {
name: 'app',components: {
TheBar,TheNavigationDrawer,TheView
},data: () => ({
}),};
</script>
<style lang="scss">
@import './styles/index.scss';
</style>
如您所见,我正在导入完整文件,该文件又导入_cards.scss
文件,该文件应具有物料卡组件的定义。这是怎么工作的?
我尝试通过向components
属性添加material-card来手动注册组件,但是由于有'-'符号,因此无法正确解析kebab-case。
令我着迷的是,原始创建者从未注册过材料卡组件,因此他的TableList.vue组件到底是怎么知道的?
我还找到了本指南-https://medium.com/@mahesh.ks/using-sass-scss-in-vue-js-2-d472af0facf9。但是我在任何地方都看不到webpack.config.js文件,这在哪里?
任何帮助将不胜感激。 :D