@@ -5,7 +5,6 @@
</template>
<script>
import qs from 'qs'
-
export default {
name: 'iframe',
data: function () {
@@ -16,6 +15,14 @@ export default {
created() {
this.getUrlLink()
},
+ watch: {
+ '$route' (to, from) {
+ // to 表示新的路由对象
+ // from 表示旧的路由对象
+ // console.log(`路由地址由 ${from.path} 变为 ${to.path}`);
+ this.getUrlLink()
+ }
+ },
methods: {
getUrlLink() {
let newParam = this.$route.query