Search code examples
vue.jssafariosx-mavericks

Vue.js not working on safari 7.1 desktop (old maverick version)


I know is an old version but just wondering if there is a way to support vue.js there

import Vue from 'vue'
import { sync } from 'vuex-router-sync'
import App from './components/App'
import router from './router'
import store from './store'

sync(store, router);


const root = document.getElementById('app-stuff');

const app = new Vue({
  router,
  store,
  propsData: {
    'stuff': root.getAttribute('data-stuff')
  },
  ...App

})

export { app, router, store }

The error is:

TypeError: undefined is not a function (evaluating 'Object.assign({router:a.a,store:s.a,propsData:{language:c.getAttribute("data-stuff")}},o.a)')

Could it be fixed or not at all really?


Solution

  • Safari 7.1 does not define Object.assign. If you need functionality that is not available in older browsers, you can add it by defining it yourself. Doing so is called a "polyfill". A polyfill for this specific function can be found on mdn. For a more full-fledged polyfill you could for example use babel's polyfill. Please note that I am not 100% what that polyfills for Safari 7.1, as I normally work with somewhat newer browsers.