我遵循 Buefy 指南
npm install Buefy
在 main.ts
import Vue from 'vue';
import Buefy from 'buefy';
import axios from 'axios';
import VueAxios from 'vue-axios';
import 'buefy/dist/buefy.css';
import App from './App.vue';
import router from './router';
import store from './store';
Vue.config.productionTip = false;
Vue.use(VueAxios, axios, Buefy);
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app');
在 Home.vue 中(查看)
<section>
<b-button @click="clickMe">
Click Me
</b-button>
</section>
然后当我运行时,我得到了这个错误
Unknown custom element: <b-button> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <Home> at src/views/Home.vue
<App> at src/App.vue
<Root>
我认为 Vue.use(Buefy) 会加载所有组件?
为了让 Buefy 工作,我缺少什么?