vue elementui scope 週記

 

Q1:獲取到id   顯示 title 回傳id?vue

 

 

Q2:element-ui之table 選擇框禁用vue-router

 

var Main = {   data() {     return {       tableData: [{           date: '2018',           name: '小海',           address: '上海市'         }, {           date: '2016',           name: '小北',           address: '北京'         }, {           date: '2012',           name: '小張',           address: '張家口'         }, {           date: '2011',           name: '小胡',           address: '湖北'         }],         multipleSelection: []     }   },   methods: {     handleSelectionChange(val) {       this.multipleSelection = val     },     checkSelectable(row) {       return row.date < 2016     }   },   template: `   <div>     <el-table     :data="tableData"     @selection-change="handleSelectionChange">     <el-table-column       type="selection"       :selectable="checkSelectable"       width="50">     </el-table-column>     <el-table-column       inline-template       label="年"       width="120">       <div>{{ row.date }}</div>     </el-table-column>     <el-table-column       prop="name"       label="姓名"       width="120">     </el-table-column>     <el-table-column       prop="address"       label="地址"       show-tooltip-when-overflow>     </el-table-column>   </el-table>   {{ multipleSelection }}   </div>   ` } new Vue({   el: '#app',   render: h => h(Main) })

 

Q3:路由傳值:element-ui

 

<router-link :to="{path:'/classManage/coursetemplate/addcourse',query:{id:scope.row.id}}"> </router-link>

 

Q4:vue-router同路由$router.push不跳轉:api

watch: {
    '$route' (to, from) {
        this.$router.go(0);
    }

 

Q5:必填的那個紅色**:app

<div class="title">
        <i class="el-icon-edit-outline"></i>基礎信息 <sup>*</sup>
      </div

 

Q6:萬能京給改的:fetch

大概就是由於過去選擇選項和數據的數據問題一直報錯無果:ui

getData() {
      //京哥給寫的2
      Promise.all([getFranchisee(), getCoursetype()])
        .then(response => {
          console.log("1");
          this.franchisees = response[0];
          console.log(this.franchisees);
          let data = response[1].filter(i => {
            return i.type != "0";
          });
          this.xiangmu = data;
          this.getDetail();
        })
        .catch(err => {
          console.log(err);
          this.$message({
            message: "獲取數據失敗,請刷新重試",
            type: "error"
          });
        });
    },


//api中:
//獲取類型列表
  export function getFranchisee() {
    return fetch({
    url: 'v2/new-apps/get-join-clubs',
    method: 'get',
  })
}
 

 

Q7:element 序號   scope.$index獲取Index:this

 

 

Q8.導出文件url

--------------------- 總有一天   我也會很膩害 ---------------------spa

相關文章
相關標籤/搜索