{"record":{"id":"8e42c32da5f9aef5","repo":"Meituan-Dianping/mpvue","slug":"key-is-a-reserved-attribute-and-cannot-be-use","errorCode":null,"errorMessage":"\"${key}\" is a reserved attribute and cannot be used as component prop.","messagePattern":"\"(.+?)\" is a reserved attribute and cannot be used as component prop\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/weex-vue-framework/factory.js","lineNumber":3095,"sourceCode":"  }\n}\n\nfunction initProps (vm, propsOptions) {\n  var propsData = vm.$options.propsData || {};\n  var props = vm._props = {};\n  // cache prop keys so that future props updates can iterate using Array\n  // instead of dynamic object key enumeration.\n  var keys = vm.$options._propKeys = [];\n  var isRoot = !vm.$parent;\n  // root instance props should be converted\n  observerState.shouldConvert = isRoot;\n  var loop = function ( key ) {\n    keys.push(key);\n    var value = validateProp(key, propsOptions, propsData, vm);\n    /* istanbul ignore else */\n    if (process.env.NODE_ENV !== 'production') {\n      if (isReservedAttribute(key) || config.isReservedAttr(key)) {\n        warn(\n          (\"\\\"\" + key + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n          vm\n        );\n      }\n      defineReactive$$1(props, key, value, function () {\n        if (vm.$parent && !isUpdatingChildComponent) {\n          warn(\n            \"Avoid mutating a prop directly since the value will be \" +\n            \"overwritten whenever the parent component re-renders. \" +\n            \"Instead, use a data or computed property based on the prop's \" +\n            \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n            vm\n          );\n        }\n      });\n    } else {\n      defineReactive$$1(props, key, value);\n    }","sourceCodeStart":3077,"sourceCodeEnd":3113,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/packages/weex-vue-framework/factory.js#L3077-L3113","documentation":"Dev-only warning in initProps while declaring props: the component uses key or ref as a prop name. These are reserved attributes handled by Vue itself (vnode key and element ref) and are stripped before props are set, so declaring them as props can never receive the intended data.","triggerScenarios":"Thrown at packages/weex-vue-framework/factory.js:3095 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the prop to something non-reserved, e.g. itemKey or refId","Pass the value via a normal prop or attribute instead of key/ref"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}