_FengQi_
_FengQi_
  • 发布:2021-03-21 00:13
  • 更新:2021-03-21 00:13
  • 阅读:519

【报Bug】Object.prototype

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win 10

HBuilderX类型: 正式

HBuilderX版本号: 3.1.4

浏览器平台: Chrome

浏览器版本: 88.0.4324.150(正式版本) (64 位)

项目创建方式: HBuilderX

示例代码:

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()  

操作步骤:

报错

预期结果:

没有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

2021-03-21 00:13 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复