Vue: Can't use template in single file component

Created on 14 Jun 2017  ·  3Comments  ·  Source: vuejs/vue

Version

2.3.4

Reproduction link

https://github.com/wansj/shift

Steps to reproduce

1.meteor create project-name --full
2.meteor remove blaze-template reactive-var standard-minifier-css
3.meteor add akryum:vue-component static-html juliancwirko:postcss
4.create App.vue and NotFound.vue in the imports/ui/pages directory, The content can be found https://github.com/wansj/shift/blob/master/imports/ui/pages/App.vue and https://github.com/wansj/shift/blob/master/imports/ui/pages/NotFound.vue
5.Replace the imports/startup/client/routes.js with https://github.com/wansj/shift/blob/master/imports/startup/client/routes.js
6.Replace the imports/startup/client/index.js with https://github.com/wansj/shift/blob/master/imports/startup/client/index.js
7.meteor run

What is expected?

Help!

What is actually happening?

I got:

I'm writing a vue meteor app, and I used the akryum:[email protected] package.My vue version is 2.3.4, meteor version is 1.5.

Most helpful comment

Vue ships in 2 variants, runtime-only has no template-compiler in runtime, to use standalone build you can use import Vue from 'vue/dist/vue.esm.js' instead of import Vue from 'vue'.

P.S. please to ask questions use forum or gitter instead of opening issues on github.

All 3 comments

Vue ships in 2 variants, runtime-only has no template-compiler in runtime, to use standalone build you can use import Vue from 'vue/dist/vue.esm.js' instead of import Vue from 'vue'.

P.S. please to ask questions use forum or gitter instead of opening issues on github.

@nickmessing Thank you, I will have a try.

_import Vue from 'vue/dist/vue.esm.js'_ caused Uncaught SyntaxError: Unexpected token export. Because vue.esm.js uses es6 module export, which can't be recoginized by meteor even if I add the poorvavyas:es6-shim package. But _import Vue from 'vue/dist/vue.js'_ works for me.

Was this page helpful?
0 / 5 - 0 ratings