MCPcopy Create free account
hub / github.com/TruthHun/BookStack / model

Function model

static/vuejs/vue.js:5686–5738  ·  view source on GitHub ↗
(
  el,
  dir,
  _warn
)

Source from the content-addressed store, hash-verified

5684var CHECKBOX_RADIO_TOKEN = '__c';
5685
5686function model (
5687 el,
5688 dir,
5689 _warn
5690) {
5691 warn$1 = _warn;
5692 var value = dir.value;
5693 var modifiers = dir.modifiers;
5694 var tag = el.tag;
5695 var type = el.attrsMap.type;
5696
5697 {
5698 var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
5699 if (tag === 'input' && dynamicType) {
5700 warn$1(
5701 "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
5702 "v-model does not support dynamic input types. Use v-if branches instead."
5703 );
5704 }
5705 // inputs with type="file" are read only and setting the input's
5706 // value will throw an error.
5707 if (tag === 'input' && type === 'file') {
5708 warn$1(
5709 "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
5710 "File inputs are read only. Use a v-on:change listener instead."
5711 );
5712 }
5713 }
5714
5715 if (tag === 'select') {
5716 genSelect(el, value, modifiers);
5717 } else if (tag === 'input' && type === 'checkbox') {
5718 genCheckboxModel(el, value, modifiers);
5719 } else if (tag === 'input' && type === 'radio') {
5720 genRadioModel(el, value, modifiers);
5721 } else if (tag === 'input' || tag === 'textarea') {
5722 genDefaultModel(el, value, modifiers);
5723 } else if (!config.isReservedTag(tag)) {
5724 genComponentModel(el, value, modifiers);
5725 // component v-model doesn't need extra runtime
5726 return false
5727 } else {
5728 warn$1(
5729 "<" + (el.tag) + " v-model=\"" + value + "\">: " +
5730 "v-model is not supported on this element type. " +
5731 'If you are working with contenteditable, it\'s recommended to ' +
5732 'wrap a library dedicated for that purpose inside a custom component.'
5733 );
5734 }
5735
5736 // ensure runtime directive metadata
5737 return true
5738}
5739
5740function genCheckboxModel (
5741 el,

Callers

nothing calls this directly

Calls 5

genSelectFunction · 0.70
genCheckboxModelFunction · 0.70
genRadioModelFunction · 0.70
genDefaultModelFunction · 0.70
genComponentModelFunction · 0.70

Tested by

no test coverage detected