question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does vue init remove {{mydata}} from my template fork?

See original GitHub issue

I created a fork of the webpack-simple template.

In this template I defined the following vue single file component:

page1.vue

<template lang="jade">
  f7-page(hide-bars-on-scroll='')
    f7-navbar(back-link='Back', title='Page 1', sliding='')
    f7-block This is page 1.
      br
      | Data-binding {{mydata}}!
      p.red This text is 
       span red
      p.cursive This is 
        span cursive
</template>

<script>
export default {
  name: 'page1',
  data () {
    return {
      mydata: 'works'
    }
  }
}
</script>

<style lang="sass?indentedSyntax">
  .red
    span
      color: red

  .cursive
    span
      font-style: italic
</style>

As you can see, I have bound the string “works” to {{mydata}}.

However, if I download the template via vue cli like this…

vue init valnub/vue-framework7-webpack-template temptest
cd temptest
npm install
npm run dev

… then the following line:

| Data-binding {{mydata}}!

has changed to this:

| Data-binding !

What’s going on? How is it possible, that {{mydata}} exists in the template but after using vue cli it’s gone?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
LinusBorgcommented, Aug 2, 2017

our member egoist has made a tool similar to vue-cli, but also a bit more flexible, and it’s using EJS instead of handlebars (<% %>):

https://github.com/egoist/sao

That would mean your users have to install another CLI tool, but it works very similar and would get your going.

0reactions
bachi76commented, Aug 2, 2017

Thanks a lot @LinusBorg, SAO indeed solves my immediate problem. Already created #546 though, feel free to close it (though the change still might be considerable given the probs it would solve 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips & Best Practices - vue.js
The reason for this is that Vue observes data changes by recursively walking the data object and converting existing properties into reactive getters...
Read more >
[Vue warn]: Property or method is not defined on the instance ...
Problem. [Vue warn]: Property or method "changeSetting" is not defined on the instance but referenced during render.
Read more >
vuetify parallax not working
As Vuetify imports styles with JS, without this option, they do not get picked up by SSR. My data source is a SharePoint...
Read more >
Migration to Vue 3 - GitLab Docs
Filters are removed from the Vue 3 API completely. ... In Vue 3, { functional: true } option is removed and <template functional>...
Read more >
Understanding Vue.js Lifecycle Hooks - DigitalOcean
beforeCreate. The beforeCreate hook runs at the initialization of your component - data has not been made reactive, and events have ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found