Why does vue init remove {{mydata}} from my template fork?
See original GitHub issueI created a fork of the webpack-simple template.
In this template I defined the following vue single file component:
<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:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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 😃.