大家好,我是Vue JS的新手,我正在try 使用单文件模板在我的过滤器上使用mixin,我遇到了一些困难
我犯了个错误
Unknown custom element: <side-bar-one> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
组成部分js
Vue.component('sideBarOne', require('./component/sidebars/男爵.vue'));
男爵.vue
import { default as config } from '../../../config';
import { filters as filter } from '../../../mixins/filters';
export default {
mixins: [
filter,
],
mounted: function() {
}
}
过滤器.js
import { default as config } from '../config';
module.exports = {
filters: {
useLGLogo( str ) {
if( str ) {
return config.LG_LOGO + str.replace(/\s+/g, '-').toUpperCase() + '.png';
}
},
useMDLogo( str ) {
if( str ) {
return config.MD_LOGO + str.replace(/\s+/g, '-').toUpperCase() + '.png';
}
},
useSMLogo( str ) {
if( str ) {
return config.SM_LOGO + str.replace(/\s+/g, '-').toUpperCase() + '.png';
}
},
}
};