huibing.xie | 1f1606f | 2018-08-20 15:46:55 +0800 | [diff] [blame^] | 1 | <template> |
| 2 | <div class="dashboard-container"> |
| 3 | <div class="dashboard-text">name:{{name}}</div> |
| 4 | <div class="dashboard-text">roles:<span v-for='role in roles' :key='role'>{{role}}</span></div> |
| 5 | </div> |
| 6 | </template> |
| 7 | |
| 8 | <script> |
| 9 | import { mapGetters } from 'vuex' |
| 10 | |
| 11 | export default { |
| 12 | name: 'dashboard', |
| 13 | computed: { |
| 14 | ...mapGetters([ |
| 15 | 'name', |
| 16 | 'roles' |
| 17 | ]) |
| 18 | } |
| 19 | } |
| 20 | </script> |
| 21 | |
| 22 | <style rel="stylesheet/scss" lang="scss" scoped> |
| 23 | .dashboard { |
| 24 | &-container { |
| 25 | margin: 30px; |
| 26 | } |
| 27 | &-text { |
| 28 | font-size: 30px; |
| 29 | line-height: 46px; |
| 30 | } |
| 31 | } |
| 32 | </style> |