[Vuejs]-Vue: Using an external script method after 'requiring' it

0👍

var test = { 
 foo () { 
  console.log('foo') 
 },
 bar () { 
  console.log('bar') 
 },
 baz () { 
  console.log('baz') 
 }
}
export default test

<script> 
import test from '@/mylib'
console.log(test.foo())
...
</script>

Leave a comment