43 lines
902 B
JavaScript
43 lines
902 B
JavaScript
/**
|
|
* 顶部header
|
|
*/
|
|
Vue.component("carousel-element", {
|
|
template: `
|
|
<el-carousel trigger="click" :height="height+'px'">
|
|
<el-carousel-item v-for="item in data">
|
|
<div style="position: relative;width: 100%;height: 100%">
|
|
<img :src="item.url" width="100%" height="100%">
|
|
<div style="position: absolute;width: 100%;bottom: 0;background: rgba(0,0,0,0.5);padding: 5px 0;text-align: center">
|
|
{{item.text}}
|
|
</div>
|
|
</div>
|
|
</el-carousel-item>
|
|
</el-carousel>
|
|
`,
|
|
props: {
|
|
data:{
|
|
type:Array
|
|
},
|
|
height:{
|
|
type: Number
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
mounted(){
|
|
this.init()
|
|
},
|
|
methods: {
|
|
init(){
|
|
|
|
},
|
|
},
|
|
watch:{
|
|
|
|
}
|
|
|
|
})
|