Object.prototype.xiba = function(){console.log("xiba")};
console.log(Object.prototype)
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
- 发布:2021-03-21 00:13
- 更新:2021-03-21 00:13
- 阅读:535
产品分类: uniapp/H5
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win 10
HBuilderX类型: 正式
HBuilderX版本号: 3.1.4
浏览器平台: Chrome
浏览器版本: 88.0.4324.150(正式版本) (64 位)
项目创建方式: HBuilderX
示例代码:
操作步骤:
报错
报错
预期结果:
没有error
没有error
实际结果:
全是error
全是error
bug描述:
使用
String.prototype.xiba = function(){};
不报错,能正常使用
使用
Object.prototype.xiba = function(){};
当场报错
[Vue warn]: Invalid prop: type check failed for prop "xiba". Expected , got Function
found in
chunk-vendors.js:3874 [Vue warn]: The computed property "xiba" is already defined in data.
found in
chunk-vendors.js:3874 [Vue warn]: Invalid prop: type check failed for prop "xiba". Expected , got Function
chunk-vendors.js:3874 [Vue warn]: Method "xiba" has already been defined as a prop.
chunk-vendors.js:3874 [Vue warn]: Computed property "xiba" was assigned to but it has no setter.
chunk-vendors.js:3874 [Vue warn]: The computed property "xiba" is already defined in data.
found in
---> <Layout>
<App>
at App.vue
0 个回复