Merge branch '2.0'

This commit is contained in:
zhigang.li 2018-11-28 11:34:23 +08:00
commit c85574b795
2 changed files with 40 additions and 2 deletions

View File

@ -2,13 +2,32 @@
<div>
<Card>
<h2>ID: {{ $route.params.id }}</h2>
<Button @click="close">调用closeTag方法关闭本页</Button>
</Card>
</div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
name: 'argu_page'
name: 'params',
methods: {
...mapMutations([
'closeTag'
]),
close () {
/**
* 如果是调用closeTag方法普通的页面传入的对象参数只需要写name字段即可
* 如果是动态路由和带参路由需要传入query或params字段用来区别关闭的是参数为多少的页面
*/
this.closeTag({
name: 'params',
params: {
id: this.$route.params.id
}
})
}
}
}
</script>

View File

@ -2,13 +2,32 @@
<div>
<Card>
<h2>ID: {{ $route.query.id }}</h2>
<Button @click="close">调用closeTag方法关闭本页</Button>
</Card>
</div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
name: 'query'
name: 'query',
methods: {
...mapMutations([
'closeTag'
]),
close () {
/**
* 如果是调用closeTag方法普通的页面传入的对象参数只需要写name字段即可
* 如果是动态路由和带参路由需要传入query或params字段用来区别关闭的是参数为多少的页面
*/
this.closeTag({
name: 'query',
query: {
id: this.$route.query.id
}
})
}
}
}
</script>