bmui
Version:
Bluemoon Moon Components
76 lines (69 loc) • 2.08 kB
JavaScript
import MixinInput from '../mixins/input';
var __render = function __render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('ul', {
staticClass: "bmui-check_list"
}, _vm._l(_vm.items, function (item, index) {
return _c('li', {
key: index
}, [_c('label', {
staticClass: "bmui-check_list-item",
"class": {
'bmui-check_list-disabled': item.disabled
}
}, [_c('input', _vm._b({
directives: [{
name: "model",
rawName: "v-model",
value: _vm.valueInside,
expression: "valueInside"
}],
staticClass: "bmui-check_list-input",
attrs: {
"type": "checkbox",
"disabled": item.disabled
},
domProps: {
"value": typeof item === 'string' ? item : item.value,
"checked": Array.isArray(_vm.valueInside) ? _vm._i(_vm.valueInside, typeof item === 'string' ? item : item.value) > -1 : _vm.valueInside
},
on: {
"change": function change($event) {
var $a = _vm.valueInside,
$el = $event.target,
$c = $el.checked ? true : false;
if (Array.isArray($a)) {
var $v = typeof item === 'string' ? item : item.value,
$i = _vm._i($a, $v);
if ($el.checked) {
$i < 0 && (_vm.valueInside = $a.concat([$v]));
} else {
$i > -1 && (_vm.valueInside = $a.slice(0, $i).concat($a.slice($i + 1)));
}
} else {
_vm.valueInside = $c;
}
}
}
}, 'input', _vm.mixinInputProps, false)), _vm._v(" "), _c('span', {
staticClass: "bmui-check_list-text"
}, [_vm._v(_vm._s((typeof item === 'string' ? item : item.name) || 'ITEM'))])])]);
}), 0);
};
var __staticRender = [];
export default {
render: __render,
staticRenderFns: __staticRender,
name: 'BmuiCheckListLeft',
mixins: [MixinInput],
props: {
items: {
type: Array,
"default": function _default() {
return [];
}
}
}
};