apache / incubator-weex-loader

Apache License 2.0
65 stars 32 forks source link

How to load Vue component? #75

Open shinriyo opened 5 years ago

shinriyo commented 5 years ago

I want to use component

This one. https://github.com/godbasin/vue-select2

it is file src/entry.js

import Vue from 'vue'
import weex from 'weex-vue-render'

// https://weex.incubator.apache.org/guide/extend-web-render.html
import Select2 from 'v-select2-component'

weex.init(Vue)
weex.registerComponent('Select2', Select2)

but, the error happened.

 ERROR  Failed to compile with 1 errors                                                                                                                                     9:05:51 AM

 error  in ./node_modules/v-select2-component/src/Select2.vue

Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <template>
|   <div>
|     <select class="form-control" :placeholder="placeholder" :disabled="disabled"></select>

 @ ./.temp/components/HelloWorld.web.js 11:25-55
 @ multi (webpack)-dev-server/client?http://192.168.0.7:8081 ./.temp/components/HelloWorld.web.js