公共

作者: 过年好_ | 来源:发表于2021-01-11 10:13 被阅读0次

    公共注册方法

    在@下创建Vue-required文件夹中创建vue-components.js


    image.png
    先引用 import Vue from 'vue'
    

    import nullData from '@/components/NullData' //暂无数据
    Vue.component('null-data',nullData);//空数据     //使用的时候直接<null-data></null-data> 必须使用第一个参数
    
    import tagType from "@/components/tagType/tagType";//公共方法
    Vue.prototype.tagType = tagType;                             //tagType.方法()
    

    然后嘞
    在main.js中 引入

    import './vue-required/vue-component'
    import './styles/animate.min.css' //使用style
    import './styles/index.scss' // global css
    import './permission'
    

    在main.js中我们引用的import './styles/index.scss' // global css 我门可以在这个文件里写入样式

    @charset "utf-8";//utf-8
    
    @import './variables.scss';//引入其他文件中自己写的样式
    @import './utilities';
    
    
    
    
    //地方不够的时候...显示 然后加一个title属性  文字溢出
    .text-eclipse {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    
    .flex {
      display: flex;
    }
    .flow-c {//竖
      flex-flow: column;
    }
    .flow-r {//横
      flex-flow: row;
    }
    .flex-1 {
      flex: 1;
    }
    
    
    //我们可以在这里自己设计我门喜欢的element样式
    
    //Element 主要品牌颜色是鲜艳、友好的蓝色。
    $blue: #409eff;
    //¶ 辅助色
    //除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
    $success: #67c23a;
    $warning: #e6a23c;
    $danger: #f56c6c;
    $info: #909399;
    
    
    $spacer: 0px !default;
    $spacers: () !default;
    $spacers: map-merge(
      (
        0: 0px,
        5: 5px,
        10: 10px,
        15: 15px,
        20: 20px,
        50: 50px
      ),
      $spacers
    );
    
    $fonter: 12px !default;
    $fonters: () !default;
    $fonters: map-merge(
      (
        12: 12px,
        14: 14px,
        16: 16px,
        18: 18px,
        20: 20px
      ),
      $fonters
    );
    
    $wideHigh: () !default;
    $wideHigh: map-merge(
      (
        10: 10%,
        20: 20%,
        25: 25%,
        30: 30%,
        40: 40%,
        50: 50%,
        60: 60%,
        70: 70%,
        75: 75%,
        80: 80%,
        90: 90%,
        100: 100%
      ),
      $wideHigh
    );
    
    

    在main.js中回有这三句话

    import App from './App.vue'
    import router from './router'
    import store from './store'
    
    
    // new vConsole()
    new Vue({
      el: '#app',
      router,
      store,
      render: h => h(App),
    }).$mount('#app')
    
    //这就是引入了VueX
    

    在@下创建store文件夹,创建index

    import Vue from 'vue'
    import Vuex from 'vuex'
    import app from './modules/app'
    import currentUser from './modules/currentUser'//这个是用户信息
    import domain from './modules/domain'
    import getters from './getters'
    
    Vue.use(Vuex)
    
    const store = new Vuex.Store({
      modules: {
        // Append More Stores. Don't remove me
        app,
        currentUser,
        domain
      },
      getters
    })
    
    export default store
    
    

    相关文章

      网友评论

          本文标题:公共

          本文链接:https://www.haomeiwen.com/subject/upiraktx.html