|
@@ -1,16 +1,22 @@
|
|
|
<template>
|
|
|
<div class="mine">
|
|
|
<h1>this is mine component</h1>
|
|
|
- <ul>
|
|
|
+ <ul>
|
|
|
<li v-for="item in products" >
|
|
|
{{item.name}}
|
|
|
</li>
|
|
|
</ul>
|
|
|
+ <button v-on:click="btn(usid)" :data-value="usid">点击</button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script type="text/javascript">
|
|
|
import { mapState, mapActions } from 'vuex'
|
|
|
export default({
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ usid: this.$store.state.user.userInfo.id
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: mapState({
|
|
|
products: state => state.product.products
|
|
|
}),
|
|
@@ -20,10 +26,18 @@
|
|
|
methods: {
|
|
|
...mapActions([
|
|
|
'PRODUCTLIST'
|
|
|
- ])
|
|
|
+ ]),
|
|
|
+ btn: function (a) {
|
|
|
+ let value = a
|
|
|
+ console.log(value)
|
|
|
+ console.log(2)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
</script>
|
|
|
<style type="text/css" scoped>
|
|
|
-
|
|
|
+ button{
|
|
|
+ font-size: 3rem;
|
|
|
+ border:1px solid darkseagreen;
|
|
|
+ }
|
|
|
</style>
|