dolymood / vue-reactivity-polyfill

@vue/reactivity polyfill

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-reactivity-polyfill CircleCI

@vue/reactivity can not support no Proxy envs, this pkg ployfill it.

If you want to use with Vue3 to be compatible with IE9+, you need to use vue3-plugin-polyfill too.

Here is a demo, vue-next-demo.

Usage

// add polyfill
// vue-reactivity-polyfill-getownpropertynames is used to
// fix IE Obejct.getOwnPropertyNames(fn) error.
// for bundle, must imported before @vue/reactivity or vue
import 'vue-reactivity-polyfill-getownpropertynames'
import 'vue-reactivity-polyfill'
// use
import { ref } from '@vue/reactivity'
// or
import { ref } from 'vue'

New API

  • get(target, path, defaultValue)
  • set(target, key, val)
  • del(target, key)
  • getLength(target: ArrayLike)

Unsupported Cases

  • Symbol key
  • Array length
  • Dynamic prop, object[key] or array[index]
  • delete
  • objectSpread

More, see proxy-polyfill

About

@vue/reactivity polyfill


Languages

Language:TypeScript 96.1%Language:JavaScript 2.9%Language:HTML 1.0%