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

Created on 22 Jun 2019  ·  6Comments  ·  Source: haizlin/fe-interview

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

vue

Most helpful comment

一群百度选手

All 6 comments

不对原组件进行更改的:

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

可以加slot扩展

同上

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

一群百度选手

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

一群百度选手

也是个本领

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haizhilin2013 picture haizhilin2013  ·  3Comments

haizhilin2013 picture haizhilin2013  ·  3Comments

haizhilin2013 picture haizhilin2013  ·  3Comments

haizhilin2013 picture haizhilin2013  ·  3Comments

haizhilin2013 picture haizhilin2013  ·  3Comments