Skip to content

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

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

Open
haizhilin2013 opened this issue Jun 22, 2019 · 12 comments
Open
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

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

@haizhilin2013 haizhilin2013 added the vue vue label Jun 22, 2019
@xixileng
Copy link

xixileng commented Jul 1, 2019

不对原组件进行更改的:

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

@Hdj2048228
Copy link

可以加slot扩展

@TKBnice
Copy link

TKBnice commented Sep 29, 2019

同上

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

@fm1234569
Copy link

一群百度选手

@Lizhooh
Copy link

Lizhooh commented Apr 13, 2020

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

@radio-qq
Copy link

一群百度选手

也是个本领

@Good-XiaAo
Copy link

一群百度选手

牛逼plus

@violet-mio
Copy link

使用$attrs和$listeners

@hzfvictory
Copy link

extend 怎么解决

@jiansun-max
Copy link

jiansun-max commented Jul 19, 2022

一群百度选手

也是个本领

哈哈哈哈

@cheese-git
Copy link

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

@sc950828
Copy link

mixins、extends

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests