chore: prettier js codes

This commit is contained in:
陈嘉涵
2020-01-19 17:02:01 +08:00
parent 2adcfd8b8b
commit 1e864a445f
28 changed files with 333 additions and 174 deletions
+13 -4
View File
@@ -11,6 +11,18 @@ export default createComponent({
multiple: Boolean,
},
computed: {
choosed() {
const { selectedProp, skuKeyStr, skuValue } = this;
if (selectedProp && selectedProp[skuKeyStr]) {
return selectedProp[skuKeyStr].indexOf(skuValue.id) > -1;
}
return false;
},
},
methods: {
onSelect() {
this.skuEventBus.$emit('sku:propSelect', {
@@ -22,14 +34,11 @@ export default createComponent({
},
render() {
const choosed = this.selectedProp && (this.selectedProp[this.skuKeyStr] || []).indexOf(this.skuValue.id) > -1;
return (
<span
class={[
'van-sku-row__item',
{
'van-sku-row__item--active': choosed,
},
{ 'van-sku-row__item--active': this.choosed },
]}
onClick={this.onSelect}
>