- <div id="app">
- <h2 :style="[baseStyle,baseStyle1]">{{message}}h2>
- div>
- <script src="../js/vue.js">script>
- <script>
- const app=new Vue({
- el:"#app",
- data://注意此处的花括号
- {
- message:"这是一个vue模板",
- baseStyle:{backgroundColor:"red"},
- baseStyle1:{fontSize:"100px"}
- }
- })
- script>