mine.vue 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div class="mine">
  3. <h1>this is mine component</h1>
  4. <ul>
  5. <li v-for="item in products" >
  6. {{item.name}}
  7. </li>
  8. </ul>
  9. <button v-on:click="btn(usid)" :data-value="usid">点击</button>
  10. <navigation></navigation>
  11. </div>
  12. </template>
  13. <script type="text/javascript">
  14. import { mapActions } from 'vuex'
  15. import config from '../config/config'
  16. export default({
  17. data () {
  18. return {
  19. usid: this.$store.state.user.userInfo.id,
  20. products: this.$store.state.product.products
  21. }
  22. },
  23. created () {
  24. console.log(this.$store.state.user)
  25. console.log(config.shopAddress)
  26. },
  27. methods: {
  28. ...mapActions([]),
  29. btn: function (a) {
  30. console.log(this.$store.state.product.products)
  31. console.log(this.$store.state.user)
  32. }
  33. }
  34. })
  35. </script>
  36. <style type="text/css" scoped>
  37. button{
  38. font-size: 2rem;
  39. border:1px solid darkseagreen;
  40. }
  41. </style>