I found this technique to be more simple/satisfactory, as I prefer composition over inheritance:
src/shared.js
export default {
foo: function() { alert("foo!") }
}
src/yourcomponent.vue
<template>...</template>
<script>
import shared from './shared'
export default {
created() {
this.foo = shared.foo // now you can call this.foo() (in your functions/template)
}
}
</script>
This will also allow you to write Vue-agnostic tests.
NOTE: if you need foo to run in Vue-scope replace
this.foo = shared.foowiththis.foo = shared.foo.bind(this)