Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据源必须使用area-data吗, 能否通过接口获取数据源 #34

Closed
leslie-fei opened this issue Jun 14, 2018 · 4 comments
Closed

Comments

@leslie-fei
Copy link

数据源必须使用area-data吗, 能否通过接口获取数据源,如何获取

@wuliupo
Copy link
Contributor

wuliupo commented Jun 14, 2018

当然可以不用 area-data,可以自己维护一份数据,格式转换成 area-data 那种

@leslie-fei
Copy link
Author

我是要通过接口获取数据, 我在mounted() 中进行数据获取, 发送http请求获取省市数据, 但是前端还是报错Error: [vue-area-linkage]: 需要提供地区数据
<area-select ref="area" :level="1" v-model="selected" :data="region"></area-select>

export default {
        data() {
            return {
                styles: null,
                edit: false,
                selected: [],
                region: {},
            }
        },
        props: ['data'],
        mounted() {
            this.getRegions();
        
        },
        methods: {
            async getRegions() {
                var response = await regionStore.getData();
                this.region = response.data;
            }
        }
    }

我写法有问题吗

@dwqs
Copy link
Owner

dwqs commented Jun 14, 2018

@a673730411 目前是必须使用 area-data

@leslie-fei
Copy link
Author

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants