demodata.js
export const config = {
options: [
{
label: '年报',
value: '00'
},
{
label: '财务',
value: '01'
},
{
label: '组织',
value: '02'
}
]
// conectRules: {
// orgType: [
// { required: true, message: '请选择组织类型', trigger: 'change' }
// ]
// }
}
export function getData(sendOrgID) {
return fetch({
url: '/api/getData',
method: 'POST',
data: {
sendOrgID
}
})
}
使用
demodata.vue
<template>
<div>
</div>
</template>
<script>
import { config, getData } from './demodata.js'//
export default {
data () {
return {
options: config.options//
}
},
methods: {
getDataFn() {
getData('00').then((res) => {
if (res.success) {
console.log('aaa')
}
}).catch(e => {
console.log('e')
})
}
}
}
</script>
<style>
</style>
其他方式参考以下链接
点击这里