Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何在vue中使用继承了Array的子类 #10427

Closed
Diry2017 opened this issue Aug 23, 2019 · 2 comments
Closed

如何在vue中使用继承了Array的子类 #10427

Diry2017 opened this issue Aug 23, 2019 · 2 comments

Comments

@Diry2017
Copy link

如果在VUE组件中使用继承了Array的子类
只要改对象赋值进入VUE组件中 VUE会把该对象改为VUE能够监听的对象

  1. list类 继承 Array
    export class List extends Array {
    constructor(){
    super()
    }
    test()
    }
    }

2.某个VUE组件中
import { List } from './list'
export default {
data () {
return {
list: null
}
},
created () {
this.list = new List()
console.log(new List().test) // => function....
console.log(this.list.test) // => undefined
}
}

@vue-bot
Copy link
Contributor

vue-bot commented Aug 23, 2019

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!


你好,你的 issue 不符合我们所要求的格式,因此已被自动关闭。为了确保每个 issue 都提供必需的相关信息,请务必使用我们的 Issue 向导 来创建新 issue,谢谢!

@vue-bot vue-bot closed this as completed Aug 23, 2019
@Justineo
Copy link
Member

Duplicate of #9259

@Justineo Justineo marked this as a duplicate of #9259 Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants