赞
踩
- data() {
- return {
- dataValue: '',
- datalist: []
- }
- },
- methods: {
- // dictCode="data,data_name,data_num"
- // 加载数据字典
- initDictConfig() {
- // 初始化字典
- initDictOptions('data,data_name,data_num').then((res) => {
- console.log(res);
- if (res.success) {
- this.datalist = res.result
- this.dataValue = res.result[0].value;
- }
- });
- },
- }
- created () {
- this.initDictConfig();
- },
-
- <a-form layout="inline" style="width:100%;">
- <a-form-item label="label">
- <a-select
- v-model="dataValue"
- >
- <a-select-option v-for="d in datalist" :key="d.value" :value="d.value">{{ d.text }}</a-select-option>
- </a-select>
- </a-form-item>
- </a-form>
- <template>
- <a-form layout="inline" style="width:100%;">
- <a-form-item label="label">
- <a-select v-model="dataValue">
- <a-select-option v-for="d in datalist" :key="d.value" :value="d.value">{{ d.text }}</a-select-option>
- </a-select>
- </a-form-item>
- </a-form>
- </template>
-
- <script>
- import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil';
- data() {
- return {
- dataValue: '',
- datalist: []
- }
- },
-
- created () {
- this.initDictConfig();
- },
-
- methods: {
- // dictCode="data,data_name,data_num"
- // 加载数据字典
- initDictConfig() {
- // 初始化字典
- initDictOptions('data,data_name,data_num').then((res) => {
- console.log(res);
- if (res.success) {
- this.datalist = res.result
- this.dataValue = res.result[0].value;
- }
- });
- },
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。