<i id='AyVPt'><tr id='AyVPt'><dt id='AyVPt'><q id='AyVPt'><span id='AyVPt'><b id='AyVPt'><form id='AyVPt'><ins id='AyVPt'></ins><ul id='AyVPt'></ul><sub id='AyVPt'></sub></form><legend id='AyVPt'></legend><bdo id='AyVPt'><pre id='AyVPt'><center id='AyVPt'></center></pre></bdo></b><th id='AyVPt'></th></span></q></dt></tr></i><div id='AyVPt'><tfoot id='AyVPt'></tfoot><dl id='AyVPt'><fieldset id='AyVPt'></fieldset></dl></div>

<small id='AyVPt'></small><noframes id='AyVPt'>

    <tfoot id='AyVPt'></tfoot>

      • <bdo id='AyVPt'></bdo><ul id='AyVPt'></ul>
    1. <legend id='AyVPt'><style id='AyVPt'><dir id='AyVPt'><q id='AyVPt'></q></dir></style></legend>
    2. Vue Js如何在单个文件模板中使用mixins?

      Vue Js how to use in mixins in single file template?(Vue Js如何在单个文件模板中使用mixins?)

            <small id='CJ9wN'></small><noframes id='CJ9wN'>

            • <bdo id='CJ9wN'></bdo><ul id='CJ9wN'></ul>

              <legend id='CJ9wN'><style id='CJ9wN'><dir id='CJ9wN'><q id='CJ9wN'></q></dir></style></legend>
                <tbody id='CJ9wN'></tbody>
              <i id='CJ9wN'><tr id='CJ9wN'><dt id='CJ9wN'><q id='CJ9wN'><span id='CJ9wN'><b id='CJ9wN'><form id='CJ9wN'><ins id='CJ9wN'></ins><ul id='CJ9wN'></ul><sub id='CJ9wN'></sub></form><legend id='CJ9wN'></legend><bdo id='CJ9wN'><pre id='CJ9wN'><center id='CJ9wN'></center></pre></bdo></b><th id='CJ9wN'></th></span></q></dt></tr></i><div id='CJ9wN'><tfoot id='CJ9wN'></tfoot><dl id='CJ9wN'><fieldset id='CJ9wN'></fieldset></dl></div>
              • <tfoot id='CJ9wN'></tfoot>
                本文介绍了Vue Js如何在单个文件模板中使用mixins?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                大家好,我是 Vue JS 的新手,我正在尝试使用单个文件模板在我的过滤器上使用 mixins,但我遇到了一些困难

                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

                我遇到的错误

                Unknown custom element: <side-bar-one> - did you register the component correctly? For recursive components, make sure to provide the "name" option. 
                

                component.js

                component.js

                Vue.component('sideBarOne', require('./component/sidebars/sideBarOne.vue'));
                

                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';
                            }
                        },
                    }
                };
                

                推荐答案

                我已经对我的文件进行了一些更改并使其正常工作

                I'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

                sideBarOne.vue

                import { default as filters } from '../../../mixins/filters';
                    export default {
                        mixins: [
                            filters,
                        ],
                        mounted: function() {
                        }
                    }
                

                这篇关于Vue Js如何在单个文件模板中使用mixins?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                <legend id='gTZzm'><style id='gTZzm'><dir id='gTZzm'><q id='gTZzm'></q></dir></style></legend>

                  <tbody id='gTZzm'></tbody>
                <tfoot id='gTZzm'></tfoot>
                  • <i id='gTZzm'><tr id='gTZzm'><dt id='gTZzm'><q id='gTZzm'><span id='gTZzm'><b id='gTZzm'><form id='gTZzm'><ins id='gTZzm'></ins><ul id='gTZzm'></ul><sub id='gTZzm'></sub></form><legend id='gTZzm'></legend><bdo id='gTZzm'><pre id='gTZzm'><center id='gTZzm'></center></pre></bdo></b><th id='gTZzm'></th></span></q></dt></tr></i><div id='gTZzm'><tfoot id='gTZzm'></tfoot><dl id='gTZzm'><fieldset id='gTZzm'></fieldset></dl></div>
                      1. <small id='gTZzm'></small><noframes id='gTZzm'>

                          <bdo id='gTZzm'></bdo><ul id='gTZzm'></ul>