简体   繁体   English

Vue.js 中的“子类”是什么意思?

[英]What does 'subclass' mean in Vue.js?

I'm reading the documentation on Vue.extend :我正在阅读有关 Vue.extend 的文档

Create a “subclass” of the base Vue constructor.创建基本 Vue 构造函数的“子类”。 The argument should be an object containing component options.参数应该是一个包含组件选项的对象。

What does 'subclass' mean in Vue.js? Vue.js 中的“子类”是什么意思?

In Object-Oriented Programming in general, "subclass" is the term for a class that inherits functionality from another class.在一般的面向对象编程中,“子类”是指从另一个类继承功能的类的术语。

Although Vue components aren't defined explicitly as classes, the result of Vue.extend is a constructor for a Vue component that has inherited the properties from the base Vue constructor.尽管 Vue 组件没有明确定义为类,但Vue.extend的结果是一个 Vue 组件的构造函数,它继承了 Vue 基本构造函数的属性。 This constructor is what they are referring to as the "subclass" in this case.在这种情况下,这个构造函数就是他们所说的“子类”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM