|
|
@@ -41,11 +41,22 @@ export default {
|
|
|
|
|
|
mounted: function () {
|
|
|
var _self = this;
|
|
|
+ // 获取焦点对象
|
|
|
+ _self.activeElement = document.activeElement;
|
|
|
_self.$nextTick(function () {
|
|
|
_self.$refs.focusInput.focus();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ beforeUnmount: function(){
|
|
|
+ var _self = this;
|
|
|
+ // 恢复焦点对象
|
|
|
+ if(_self.activeElement != null){
|
|
|
+ _self.activeElement.focus();
|
|
|
+ _self.activeElement = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
methods: {
|
|
|
// 居中显示
|