Skip to content

[vue] vue如果想扩展某个现有的组件时,怎么做呢? #462

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

[vue] vue如果想扩展某个现有的组件时,怎么做呢?

Activity

xixileng

xixileng commented on Jul 1, 2019

@xixileng

不对原组件进行更改的:

  1. 使用Vue.extend直接扩展
  2. 使用Vue.mixin全局混入
  3. HOC封装
Hdj2048228

Hdj2048228 commented on Jul 2, 2019

@Hdj2048228

可以加slot扩展

TKBnice

TKBnice commented on Sep 29, 2019

@TKBnice

同上

  1. 使用Vue.extend直接扩展
  2. 使用Vue.mixin全局混入
  3. HOC封装
  4. 加slot扩展
fm1234569

fm1234569 commented on Jan 17, 2020

@fm1234569

一群百度选手

Lizhooh

Lizhooh commented on Apr 13, 2020

@Lizhooh

render-props 组件和 higher-order component 组件

radio-qq

radio-qq commented on Dec 31, 2020

@radio-qq

一群百度选手

也是个本领

Good-XiaAo

Good-XiaAo commented on Mar 29, 2021

@Good-XiaAo

一群百度选手

牛逼plus

violet-mio

violet-mio commented on Jun 24, 2021

@violet-mio

使用$attrs和$listeners

hzfvictory

hzfvictory commented on Jul 6, 2022

@hzfvictory

extend 怎么解决

jiansun-max

jiansun-max commented on Jul 19, 2022

@jiansun-max

一群百度选手

也是个本领

哈哈哈哈

cheese-git

cheese-git commented on Jul 19, 2022

@cheese-git
  1. 二次封装(HOC)
  2. 使用 extends option 显式“继承”
sc950828

sc950828 commented on Sep 23, 2022

@sc950828

mixins、extends

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@cheese-git@Hdj2048228@Lizhooh@xixileng

        Issue actions

          [vue] vue如果想扩展某个现有的组件时,怎么做呢? · Issue #462 · haizlin/fe-interview