vue-cli中 components插件的應用


在你要使用插件的頁面

import footerT from '@/components/footer/index.vue';//引入要使用的文件
import headerT from '@/components/header/index.vue';
    export default {
        components:{footerT,headerT}//注冊插件名
    }

 插件傳值時首先進行props暴露,data中不用出現你要暴露的值

   export default {
        data() {
            return {
                
            }
        },
        props:["magess"]
        
    }

在使用頁

<header-t :magess="title"></header-t>//header-t為此處的插件

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM