admin管理员组文章数量:1278758
Hi everyone im new to Vue JS and im trying to use mixins on my filters using single file template and I'm having some hard time
Error I'm getting
Unknown custom element: <side-bar-one> - did you register the ponent correctly? For recursive ponents, make sure to provide the "name" option.
ponent.js
Vueponent('sideBarOne', require('./ponent/sidebars/sideBarOne.vue'));
sideBarOne.vue
import { default as config } from '../../../config';
import { filters as filter } from '../../../mixins/filters';
export default {
mixins: [
filter,
],
mounted: function() {
}
}
filters.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';
}
},
}
};
Hi everyone im new to Vue JS and im trying to use mixins on my filters using single file template and I'm having some hard time
Error I'm getting
Unknown custom element: <side-bar-one> - did you register the ponent correctly? For recursive ponents, make sure to provide the "name" option.
ponent.js
Vue.ponent('sideBarOne', require('./ponent/sidebars/sideBarOne.vue'));
sideBarOne.vue
import { default as config } from '../../../config';
import { filters as filter } from '../../../mixins/filters';
export default {
mixins: [
filter,
],
mounted: function() {
}
}
filters.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';
}
},
}
};
Share
Improve this question
asked May 8, 2017 at 7:12
PenAndPapersPenAndPapers
2,1089 gold badges34 silver badges64 bronze badges
1 Answer
Reset to default 9I've made some changes on my files and made it working
filters.js
import { default as config } from '../config';
var filters = {
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';
}
},
}
};
export default filters;
sideBarOne.vue
import { default as filters } from '../../../mixins/filters';
export default {
mixins: [
filters,
],
mounted: function() {
}
}
本文标签: javascriptVue Js how to use in mixins in single file templateStack Overflow
版权声明:本文标题:javascript - Vue Js how to use in mixins in single file template? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741257391a2366945.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论