-
Notifications
You must be signed in to change notification settings - Fork 20
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
如果给过来的不是地址的索引,而是地址呢 #3
Comments
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
通常数据库中不会存 插件返回过来的索引。虽然,插件也会返回完整的地址。
假如数据库中存的用户地址是: 上海市-直辖市-徐汇区,初始化插件的时候,又该如何在 show 的时候就定位到这里呢。这个就是再次编辑的需要。而这里没有很好的提供到。我需要使用这个插件,又不能完全满足我的需要,就稍微改了一点。
在 props 中额为定义了一个 address 。使用 watch 监听它。在 引用页面对 address 进行赋值。比如我点击地址准备编辑的时候。一旦对 address 赋值,插件就会获取到,然后再调用插件里边的方法。新增的方法就可以。(VUE 我是新手,本来想找在引用页面调用插件里边的方法,没找到,只好出此下策)
watch: {
address: function() {
if (!this.address)
return;
},
methods:
addressIndex(province, city, area) {
let provinceIndex, cityIndex, areaIndex = 0;
},
initialize () {
this.handPickValueDefault();
this.provinceDataList = provinceData;
this.cityDataList = cityData[this.pickerValueDefault[0]];
this.areaDataList =
areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
this.pickerValue = this.pickerValueDefault;
},
The text was updated successfully, but these errors were encountered: