|
@@ -12,7 +12,14 @@
|
|
|
export default {
|
|
|
name: 'Home',
|
|
|
created() {},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ removeElement(element) {
|
|
|
+ for (var i = 0; i < element.length; i++) {
|
|
|
+ console.log(element[i]);
|
|
|
+ document.body.removeChild(element[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
mui('body').on('tap', '.kfz', function() {
|
|
|
mui.toast('开发中');
|
|
@@ -21,7 +28,26 @@
|
|
|
document.location.href = this.href;
|
|
|
});
|
|
|
},
|
|
|
- computed: {}
|
|
|
+ watch: {
|
|
|
+ //解决系统返回键app外的元素仍然存在的问题
|
|
|
+ '$route': function(to, from) {
|
|
|
+ var muidtpicker = document.getElementsByClassName('mui-dtpicker mui-active');
|
|
|
+ var muibackdrop = document.getElementsByClassName('mui-backdrop');
|
|
|
+ var muipoppicker = document.getElementsByClassName('mui-poppicker mui-active');
|
|
|
+ if (muidtpicker) {
|
|
|
+ this.removeElement(muidtpicker);
|
|
|
+ //console.log(muidtpicker)
|
|
|
+ }
|
|
|
+ if (muibackdrop) {
|
|
|
+ this.removeElement(muibackdrop);
|
|
|
+ //console.log(muibackdrop)
|
|
|
+ }
|
|
|
+ if (muipoppicker) {
|
|
|
+ this.removeElement(muipoppicker);
|
|
|
+ //console.log(muibackdrop)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|