zoukankan      html  css  js  c++  java
  • vue-cli element axios sass 安装

    1 vue init webpack demo

    2cnpm install

    3cnpm install element-ui -S

    4在main.js中引入

    import ElementUI from 'element-ui'

    import 'element-ui/lib/theme-chalk/index.css'

    Vue.use(ElementUI)

    5cnpm i --save-dev vuex

    import store from '@/store/store'

    在store/store.js

    import Vue from 'vue';
    import Vuex from 'vuex';
    Vue.use(Vuex)
    
    const fund = {
      state:{
        select_funds:[],//已选择的匹配基金
      },
      mutations:{
    
        SELECTFUNDS(state,data){
    
          if(data.length==0){
            state.select_funds =[];
            sessionStorage.setItem('select_funds','');
          }else{
            state.select_funds = Object.assign(state.select_funds,data)
            sessionStorage.setItem('select_funds', JSON.stringify(state.select_funds));
          }
        },
    
      },
      actions:{
        getTickets({commit,state},data){
          // api.getTickersInfo().then(res=> {
          //   res = res.data;
          //   let arr = [];
          //   if (res.code === 200) {
          //     let data = res.data;
          //     for(let i in data){
          //       arr.push({name:i,ticket:data[i][0],kind:data[i][1]})
          //     }
          //     commit('TICKETSLIST',arr)
          //   }
          //
          // })
        }
      },
      getters:{
    
        selectFunds(state){
          return state.select_funds;
        },
    
      }
    }
    for(var item in fund.state){
      if(item == 'tickets'){continue;}
      sessionStorage.getItem(item)?fund.state[item]=JSON.parse(sessionStorage.getItem(item)):false
    }
    export default new Vuex.Store({
      state:{},
      modules:{
        fund
      },
      mutations: {
      }
    })
    View Code

    5安装sass ,请看https://www.cnblogs.com/mengdiezhuangzhou/p/10196286.html

      公用sass 文件,抢看 https://www.cnblogs.com/mengdiezhuangzhou/p/10195767.html

  • 相关阅读:
    leetcode — interleaving-string
    leetcode — unique-binary-search-trees-ii
    leetcode — unique-binary-search-trees
    leetcode — binary-tree-inorder-traversal
    leetcode — restore-ip-addresses
    poj 2774 Long Long Message
    bzoj 1031 [JSOI2007]字符加密Cipher
    BZOJ4554 HEOI2016游戏
    BZOJ4552 HEOI2016排序
    BZOJ4551 HEOI2016树
  • 原文地址:https://www.cnblogs.com/mengdiezhuangzhou/p/10271378.html
Copyright © 2011-2022 走看看