quasar 常用

 

路由地址:

quasar.conf.js

 

升級本地組件

yarn upgrade -L

 

管理員身份
set-executionpolicy remotesigned

npm install -g yarn --registry=https://registry.npm.taobao.org

yarn config set registry https://registry.npm.taobao.org -g

yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g


yarn

yarn upgrade -L

yarn global add quasar-cli

npm uninstall -g quasar-cli; npm i -g [email protected]

#確保你在全局安裝了vue-cli
$ yarn global add vue-cli
# 或:
$ npm install -g vue-cli

#Node.js> = 8.9.0是必需的。
$ yarn global add quasar-cli
# 或:
$ npm install -g quasar-cli

this.$route.query  獲取url上參數

this.$store.state.Navigation.deptId 獲取當前機構用戶等信息 

 

v-if="tab==='disposalProcess' || tab==='history'"  設置對象是否顯示

過濾然後給對象添加屬性

this.allDeptList = r.data.filter((dept) => dept.id === currentDept.pid).map((v) => ({
            sel: true,
            selNum: 0,
            ...v,
          }));

計算、觀察


  computed: {
    eventNum() {
      return this.allDeptList.filter((dept) => this.eventDeptList.indexOf(dept.id) > -1)
        .filter((dept) => dept.sel).length;
    },
    selNum() {
      return function calcNum(value) {
        if (value === '00') {
          return this.allDeptList.filter((dept) => dept.id === '00')
            .filter((dept) => dept.sel).length;
        }
        return this.allDeptList.filter((dept) => dept.id === value || dept.pid === value)
          .filter((dept) => dept.sel).length;
      };
    },
    selectAll: {
      get() {
        return this.showList.length !== 0 && this.showList.filter((dept) => !dept.sel).length === 0;
      },
      set(v) {
        this.showList.forEach((dept) => {
          dept.sel = v;
        });
      },
    },
    sendTo: {
      get() {
        return this.allDeptList.filter((dept) => dept.sel);
      },
      set() {
      },
    },
    currentSelList() {
      return this.showList.filter((dept) => dept.sel);
    },
    secondDeptList() {
      return this.allDeptList.filter((dept) => dept.code.length === 2);
    },
  },
  watch: {
    sendTo(n) {
      this.unit.value = n.map((v) => v.id).join();
    },
  },

axios 

       this.loading = true;
      this.$axios.get(`label/labelByParam`).then((r) => {
      }).finally(() => {
        this.loading = false;
      });

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章