首先:項目裏的數據字典路由已經配好javascript
進入項目頁面java
引入數據字典api
import { getTypeValue } from '@/api/dict/dictValue/index';
建立前獲取到字典this
getTypeValue('org_attr_type').then(response => { this.attrTypeOptions = response.data.rows; });
設置el下拉框spa
<el-form-item label="屬性類型" prop="type"> <el-select class="filter-item" v-model="form.attrType" placeholder="請選擇機構類型"> <el-option v-for="item in attrTypeOptions" :key="item.id" :label="item.labelDefault" :value="item.value"></el-option> </el-select> </el-form-item>
注意上面的寫法是錯誤的,注意:key,:label, :value值code
搜索列表也顯示orm
<el-table-column width="200px" align="center" label="屬性類型"> <template slot-scope="scope"> <span>{{scope.row.attrType}}</span> </template> </el-table-column>