shareItem.vue
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<div>
<div class="share_item_box">
<div v-for="(item,index) in shareItems" :key="index" @click="func(item)" class="share_item">
<img class="left" :src="item.simg" alt=""/>
<div class="title">{{item.title}}</div>
<img class="right" :src="item.icon" alt=""/>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
}
},
//部件
components: {
},
//静态
props: ["shareItems"],
//对象内部的属性监听,也叫深度监听
watch: {
},
//属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用;
computed: {
},
//方法表示一个具体的操作,主要书写业务逻辑;
methods: {
/**
* 功能按钮
* @param {object} shareItems [props对象]
* @param {int} index [索引]
*/
func(item) {
if (typeof item.func === "function") {
item.func(item);
}
}
},
//请求数据
created() {
},
mounted() {
}
}
</script>
<style rel="stylesheet/less" lang="less" scoped>
@import "shareItem";
</style>