三角形
0;
height: 0;
border- 10px;
border-color: transparent transparent red transparent;
border-style: dashed dashed solid dashed
图片自适应
.img-box {
18%;
margin: 0 2% 0 0;
background-size: cover;
background-position: 50% 50%;
&::before {
content: "";
display: block;
100%;
padding-top: 100%;
}
}
对象变数组(用的vue 里的lodash)
[].concat(this.CategoryId)
for (let catItem of catItems) {
Vue.set(this.categories, `${catItem.Id}`, {})
Http.$http.get(`v1.1/CompanyCategories/${catItem.Id}?fields=SubCategories`).then((response) => {
this.categories[`${catItem.Id}`] = response.data
})
}
vue 用数据加载背景
<div :style="{ backgroundImage: 'url('+imgSrc+')' }"> js.data imgSrc:'bt_help_album-
添加组件
父组件
import companyList from './list/index.vue'
components: {
companyList
},
父组件给子组件传参
子组件
props: {
item: {
type: Object
}
},
父组件
<company-list :item="item"></company-list>
子组件给父组件传参
子组件
closeSearch() {
this.show = false
this.$emit('handleShow', this.show); //第一个参数是父组件中v-on绑定的自定义回调方法,第二个参数为传递的参数
},
父组件
<search @handleShow="changeShow()" :currType="currType" :ActionArgsJson="ActionArgsJson"></search>
changeShow(show) {
this.show = show;
},