M
M
Michael2017-07-24 11:20:54
Vue.js
Michael, 2017-07-24 11:20:54

How to connect Vue.js component from cdn?

Found a component, you need to connect.

<script>
  import Multiselect from 'vue-multiselect'

  // register globally
  Vue.component(Multiselect)

  export default {
    // OR register locally
    components: { Multiselect },
    data () {
      return {
        value: null,
        options: ['list', 'of', 'options']
      }
    }
  }
</script>

Since I use vue without assembly, I just connect from cdn, how to import the component? Now the error is " Uncaught
SyntaxError: Unexpected token import"
can't import a component without building/installing vue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2017-07-24
@DJWOMS1

https://monterail.github.io/vue-multiselect/#sub-g... point "via CDN" + google =
https://jsfiddle.net/89j7z94u/3/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question