UNPKG

framework7-vue

Version:

Build full featured iOS & Android apps using Framework7 & Vue

44 lines 1.68 kB
import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass } from "vue"; const _hoisted_1 = ["checked"]; const _hoisted_2 = ["src"]; function render(_ctx, _cache) { return _openBlock(), _createElementBlock("label", { class: _normalizeClass(_ctx.classes) }, [_createElementVNode("input", { type: "checkbox", checked: _ctx.checked, onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)) }, null, 40, _hoisted_1), _cache[1] || (_cache[1] = _createElementVNode("i", { class: "icon icon-checkbox" }, null, -1)), _ctx.image ? (_openBlock(), _createElementBlock("img", { key: 0, src: _ctx.image }, null, 8, _hoisted_2)) : _createCommentVNode("", true), _renderSlot(_ctx.$slots, "default")], 2); } import { computed } from 'vue'; import { classNames } from '../shared/utils.js'; import { colorClasses, colorProps } from '../shared/mixins.js'; export default { name: 'f7-messagebar-sheet-image', render, props: { image: String, checked: Boolean, ...colorProps }, emits: ['checked', 'unchecked', 'change', 'update:checked'], setup(props, { emit }) { const onChange = event => { if (event.target.checked) emit('checked', event);else emit('unchecked', event); emit('update:checked', event.target.checked); emit('change', event); }; const classes = computed(() => classNames('messagebar-sheet-image', 'checkbox', colorClasses(props))); return { classes, onChange }; } };